Author |
Message
|
Cogito-Ergo-Sum |
Posted: Fri May 17, 2013 11:14 am Post subject: XMLNSC parser results in CHAR datatype only. |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
To isolate another problem, I am trying an experiment. A FileInput node is wired to a Trace node to show ${Root}. The FileInput node is set-up for parsing with XMLNSC as the domain and timing as Immediate. The XSD available in the application itself.
The document:
Code: |
<X>
<meta>
<A>aType</A>
<B>2001-01-01</B>
<C>12:00:00</C>
<D>anId</D>
<E>anotherId</E>
</meta>
<detail>
<F>234252.308</F>
</detail>
</X>
|
The schema:
Code: |
<?xml version="1.0" encoding="UTF-8"?><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="X">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="meta"/>
<xsd:element maxOccurs="1" minOccurs="1" ref="detail"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="A" type="xsd:string"/>
<xsd:element name="B" type="xsd:date"/>
<xsd:element name="C" type="xsd:time"/>
<xsd:element name="D" type="xsd:string"/>
<xsd:element name="E" type="xsd:string"/>
<xsd:element name="F" type="xsd:decimal"/>
<xsd:element name="meta">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="A"/>
<xsd:element maxOccurs="1" minOccurs="1" ref="B"/>
<xsd:element maxOccurs="1" minOccurs="1" ref="C"/>
<xsd:element maxOccurs="1" minOccurs="1" ref="D"/>
<xsd:element maxOccurs="1" minOccurs="1" ref="E"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="detail">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" ref="F"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
|
The trace output:
Code: |
( ['GENERICROOT' : 0x7f43240bb670]
(0x01000000:Name ):Properties = ( ['GENERICPROPERTYPARSER' : 0x7f43240be510]
(0x03000000:NameValue):MessageSet = '' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
(0x03000000:NameValue):Encoding = 546 (INTEGER)
(0x03000000:NameValue):CodedCharSetId = 1208 (INTEGER)
(0x03000000:NameValue):Transactional = FALSE (BOOLEAN)
(0x03000000:NameValue):Persistence = FALSE (BOOLEAN)
(0x03000000:NameValue):CreationTime = GMTTIMESTAMP '2013-05-17 19:10:57.788762' (GMTTIMESTAMP)
(0x03000000:NameValue):ExpirationTime = -1 (INTEGER)
(0x03000000:NameValue):Priority = 0 (INTEGER)
(0x03000000:NameValue):ReplyIdentifier = X'' (BLOB)
(0x03000000:NameValue):ReplyProtocol = 'ADAPTOR' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceType = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceToken = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
(0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedType = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedToken = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
(0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
)
(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0x7f4324028890]
(0x01000000:Folder):X = (
(0x01000000:Folder):meta = (
(0x03000000:PCDataField):A = 'aType' (CHARACTER)
(0x03000000:PCDataField):B = '2001-01-01' (CHARACTER)
(0x03000000:PCDataField):C = '12:00:00' (CHARACTER)
(0x03000000:PCDataField):D = 'anId' (CHARACTER)
(0x03000000:PCDataField):E = 'anotherId' (CHARACTER)
)
(0x01000000:Folder):detail = (
(0x03000000:PCDataField):F = '234252.308' (CHARACTER)
)
)
)
)
|
How do I get date for C, time for D and decimal for F elements ? Because F is parsed as character, I am unable to do a computation in the subsequent flow. _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 17, 2013 11:27 am Post subject: Re: XMLNSC parser results in CHAR datatype only. |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Cogito-Ergo-Sum wrote: |
The XSD available in the application itself. |
What does this mean? Application as in WMBv8 application?
Unless the File Input node has the schema available by a method appropiate to your level of broker and you've checked the box marked "Build tree using XML schema data types" unser "XMLNSC parser options" then yes, all you get are strings. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Fri May 17, 2013 12:42 pm Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Vitor wrote: |
What does this mean? Application as in WMBv8 application?
|
Yes.
Vitor wrote: |
...you've checked the box marked "Build tree using XML schema data types" unser "XMLNSC parser options" then yes, all you get are strings. |
I hadn't checked the box. It is greyed out for me ... _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
kimbert |
Posted: Fri May 17, 2013 1:43 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Set 'Validation' to 'Content and Value'.
Reason: The parser has no way of knowing the data types of the elements/attributes unless it matches the XML document against the xsd(s). Once it has done that, it might as well do the validation - most of the hard work has already been done. |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri May 17, 2013 2:11 pm Post subject: Re: XMLNSC parser results in CHAR datatype only. |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
Cogito-Ergo-Sum wrote: |
The XSD available in the application itself. |
If the xsd were associated with the message, wouldn't it show up here?
Cogito-Ergo-Sum wrote: |
The trace output:
Code: |
( ['GENERICROOT' : 0x7f43240bb670]
(0x01000000:Name ):Properties = ( ['GENERICPROPERTYPARSER' : 0x7f43240be510]
(0x03000000:NameValue):MessageSet = '' (CHARACTER)
(0x03000000:NameValue):MessageType = '' (CHARACTER)
(0x03000000:NameValue):MessageFormat = '' (CHARACTER)
...
)
|
|
How is the 'Message Model' set on the FileInput node 'Input Message Parsing' tab? |
|
Back to top |
|
 |
dogorsy |
Posted: Fri May 17, 2013 10:07 pm Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
set validation to contents and value in the input node. |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Sun May 19, 2013 5:27 am Post subject: |
|
|
 Master
Joined: 07 Feb 2006 Posts: 293 Location: Bengaluru, India
|
Thanks, kimbert and Vitor.
Your answers were right in front and yet, I didn't see it. Sorry, next time, I will check better. _________________ ALL opinions are welcome.
-----------------------------
Debugging tip:When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
---Sherlock Holmes |
|
Back to top |
|
 |
|