Author |
Message
|
MiLi |
Posted: Wed May 28, 2008 3:52 am Post subject: xsd:date in messageset with timezon |
|
|
Acolyte
Joined: 07 Oct 2005 Posts: 51
|
Hi
I import an xsd with xsd:date field.
Acoording to W3Schools:
Quote: |
The following is an example of a date declaration in a schema:
<xs:element name="start" type="xs:date"/>
An element in your document might look like this:
<start>2002-09-24</start>
Time Zones
To specify a time zone, you can either enter a date in UTC time by adding a "Z" behind the date - like this:
<start>2002-09-24Z</start>
or you can specify an offset from the UTC time by adding a positive or negative time behind the date - like this:
<start>2002-09-24-06:00</start>
or
<start>2002-09-24+06:00</start> |
So the xsd:date can be with or without timezone but the broker only accepts without timzone !
Am I missing something, dont want to change messageset xsd:date to xsd:datetime ??? _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Instructor - WebSphere MQ, WebSphere Message Broker |
|
Back to top |
|
 |
kimbert |
Posted: Wed May 28, 2008 4:08 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
It's a known issue with the MRM parser. If you're on v6.1, you should be using XMLNSC for XML parsing and validation. |
|
Back to top |
|
 |
capistrano |
Posted: Thu Nov 13, 2008 1:56 am Post subject: |
|
|
 Novice
Joined: 28 Jun 2005 Posts: 13 Location: Dublin
|
Hmm. I am having exactly this problem on a WMB 6.0 application using MRM XML.
Is the only option to upgrade to WMB 6.1 and use XMLNSC?
Could the "I" datetime format not be extended to accept the optional timezone on dates? Or maybe a new type, say "IX", could be added that exactly matches the XML Schema date and time formats. |
|
Back to top |
|
 |
kimbert |
Posted: Thu Nov 13, 2008 3:09 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
No, there are other options. Have you tried switching off 'Strict Datetime Checking' in the message set options for the XML physical format?
If that doesn't work, you can
- define your element/attribute as xs:string instead of xs:date
- append a timezone of 00:00
- convert to date ( if necessary ) using ESQL CAST.
If your message flow only copies the xs:date into the output tree, then only the first step would be required. |
|
Back to top |
|
 |
capistrano |
Posted: Thu Nov 13, 2008 7:36 am Post subject: |
|
|
 Novice
Joined: 28 Jun 2005 Posts: 13 Location: Dublin
|
BTW Thanks for all the help.
Okay, so I'm testing the application now on WMB 6.1 using XMLNSC.
However, all the fields are being parsed as type CHARACTER (that is dates, decimals etc are all CHARACTER type in the parsed message tree). It's as if it is parsing without regard to the schema at all!
The xsdzip file is deployed.
I am parsing using the CREATE PARSE command in ESQL, specifying the message set name as an option.
Can you tell me the parameters needed for the PARSE clause to parse XMLNSC domain using a schema? |
|
Back to top |
|
 |
kimbert |
Posted: Thu Nov 13, 2008 9:13 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
XMLNSC can work either way. By default it builds a message tree containing CHARACTER data, because that was the way it used to work in v6.0.
If you have a schema AND if validation is set to 'Content and Value' then you can tick the Parser Option 'Build tree using XML Schema types'. Then you will get the integers, dates etc in the tree.
The equivalent in ESQL is
Code: |
DECLARE myOptions INTEGER BITOR(
ValidateContent,
ValidateValue,
XMLNSC.BuildTreeUsingSchemaTypes);
CREATE LASTCHILD OF OutputRoot.XMLNSC DOMAIN 'XMLNSC' PARSE (
myBLOB
CCSID InputRoot.Properties.CodedCharSetId
SET 'myMessageSet'
OPTIONS myOptions
);
|
|
|
Back to top |
|
 |
capistrano |
Posted: Fri Nov 14, 2008 4:00 am Post subject: |
|
|
 Novice
Joined: 28 Jun 2005 Posts: 13 Location: Dublin
|
I've altered my CREATE PARSE ESQL to follow your suggestion but I get a deployment error:
BIP2432E: (PhysicalTransmissionFlow.BeginMapper_Compute.Main, 17.82) : The correlation name 'XMLNSC.BuildTreeUsingSchemaTypes' is not valid.
Also, I can'f find any mention of XMLNSC.BuildTreeUsingSchemaTypes in the Info Centre. Are you sure this is correct? What's the integer value for this option and I can try that? |
|
Back to top |
|
 |
kimbert |
Posted: Fri Nov 14, 2008 5:11 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Sorry - that's a defect. It will be fixed in v6.1.0.3.
For now, this will work:
Code: |
DECLARE buildTreeUsingSchemaTypes INTEGER 0x8000000000000;
DECLARE myOptions INTEGER BITOR(
ValidateContent,
ValidateValue,
buildTreeUsingSchemaTypes);
CREATE LASTCHILD OF OutputRoot.XMLNSC DOMAIN 'XMLNSC' PARSE (
myBLOB
CCSID InputRoot.Properties.CodedCharSetId
SET 'myMessageSet'
OPTIONS myOptions
); |
|
|
Back to top |
|
 |
capistrano |
Posted: Fri Nov 14, 2008 5:27 am Post subject: |
|
|
 Novice
Joined: 28 Jun 2005 Posts: 13 Location: Dublin
|
Perfick!
All working now! |
|
Back to top |
|
 |
|