Originally posted by: nexusis
This is a section of the target XML file generated from maps developed and compiled in Windows XP development environment, deployed to Windows OS(2003) test and production environments. The XML type trees were generated from valid .xsd schemata on Windows XP.
<?xml version="1.0" encoding="UTF-8" ?>
<OrderMessage>
<TransactionInfo>
<MessageSender>99-999-9999</MessageSender>
<MessageRecipient>DUMMY_ORG</MessageRecipient>
<MessageID>000000106</MessageID>
<Created>2007-09-27T20:47:00.12345</Created>
<FileName>ST0001_Dummy_PO_Line_Item_inputfile.edi</FileName>
</TransactionInfo>
The mapping rule (and there are a few ways to get this result) here:
= TODATETIME ( LEFT ( DATETOTEXT (InterchangeDate) , 4 )
"-" MID ( DATETOTEXT (InterchangeDate), 5 , 2)
"-" RIGHT ( DATETOTEXT ( InterchangeDate ), 2)
+ "T" + LEFT ( TIMETOTEXT ( InterchangeTime ), 2 )
+ ":" + MID ( TIMETOTEXT ( InterchangeTime ) , 3, 2)
+ ":" + InterchangeTime_Seconds ,
"{CCYY-MM-DD}T{HH24:MM:SS.0-6}" )
Where InterchangeTime_Seconds is a text value = 00.12345
You can also do a simple test with a string as input and create the XML target element defining it UTC format without GMT offset.
= TODATETIME ( LEFT ( UTC_datetime_test , 4 )
"-" MID ( UTC_datetime_test , 5 , 2)
"-" MID ( UTC_datetime_test , 7 , 2)
+ "T" + MID ( UTC_datetime_test , 9, 2 )
+ ":" + MID ( UTC_datetime_test , 11, 2)
+ ":" + RIGHT ( UTC_datetime_test , 8 ) ,
"{CCYY-MM-DD}T{HH24:MM:SS.0-6}" )
This is the source string:
20070927204700.12345
<TransactionInfo>
<MessageSender>Dummy_SenderID</MessageSender>
<MessageRecipient>Dummy_RecipientID</MessageRecipient>
<MessageID>MessageID</MessageID>
<Created>2007-09-27T20:47:00.12345</Created>
<FileName>20070927204700.12345</FileName>
</TransactionInfo>
The "Created" xml element was generated by WTX from a valid .xsd schema as a DateTime item with this definition:
{CCYY-MM-DD}T{HH24:MM:SS
http://.0-6+/-ZZ:ZZ}
nexusis
#IBMSterlingTransformationExtender#IBM-Websphere-Transformation-Extender#DataExchange