Author |
Message
|
mbtc |
Posted: Mon Oct 07, 2013 6:30 am Post subject: Timestamp timezone/offset trucated when using 'Build Tree' |
|
|
Newbie
Joined: 04 Oct 2013 Posts: 5
|
Time-stamp timezone/offset component truncated when using 'Build tree using XML schema type'
I have identified the following behavior, and was wondering if it is a bug?
Message Broker 8.0.0.2
The timezone/offset is truncated when build message tree is selected.
The outcome is that you no longer know where the time is GMT or BST (summer time).
Example:
The message flow has an MQ Input Node:
>Input Message Parsing
> Domain: XMLNSC
> Model: (blnak as the project has a XSD defined in a library)
>>Parser Options
>> Build tree using XML schema type: ticked
>Validation
>> Validation: Content & Value
ESQL:
Code: |
DECLARE ns NAMESPACE 'http://mydomain';
DECLARE input REFERENCE TO InputRoot.XMLNSC.ns:MyMessage;
DECLARE dt TIMESTAMP CAST(FIELDVALUE(input.Data.(XMLNSC.Attribute)timestamp) AS TIMESTAMP FORMAT 'IU');
|
An input of:
Code: |
<tns:MyMessage xmlns:tns="http://mydomain">
<Data timestamp="2013-06-22T12:33:22+01:00" />
</tns:MyMessage>
|
Gives the following dt value: 2013-06-22T12:33:22
A time-stamp of: 2013-06-22T12:33:22Z
Gives the following dt value: 2013-06-22T12:33:22
It seems like the field has already been cast to a standard TIMESTAMP before I can apply the FORMAT 'UI' line. |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Oct 07, 2013 6:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
timestamp data in the LOGICAL message tree has no format.
The only place timestamp data has a format is in a bitstream. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Oct 07, 2013 8:36 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Also you do not want it defined as TIMESTAMP but you want the field defined as GMTTIMESTAMP! Defining your field as timestamp has ramifications you don't want to get into.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Simbu |
Posted: Mon Oct 07, 2013 9:32 pm Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
Hope this info will help you.
Quote: |
By default, the XMLNSC parser uses the CHARACTER data type for all element and attribute values that the parser creates in the message tree. However, if you are using the XMLNSC parser to validate the XML document, you can select Build tree using XML Schema data types in the Parser options page of the input node. This causes element and attribute values to be cast to the message broker data type that most closely matches their XML Schema simple type. The exact mapping between XML schema types and message broker types can be found in XMLNSC data types |
http://pic.dhe.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/ak34050_.htm |
|
Back to top |
|
 |
mbtc |
Posted: Wed Oct 09, 2013 1:12 am Post subject: |
|
|
Newbie
Joined: 04 Oct 2013 Posts: 5
|
Thanks Simbu, this makes it clear what I thought was happening.
I usually do have 'Build message tree' checked.
It is a shame that by default it casts it to TIMESTAMP, as the equivalent XML data type can have a time zone.
Cheers. |
|
Back to top |
|
 |
|