ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XMLNSC parser results in CHAR datatype only.

Post new topic  Reply to topic
 XMLNSC parser results in CHAR datatype only. « View previous topic :: View next topic » 
Author Message
Cogito-Ergo-Sum
PostPosted: Fri May 17, 2013 11:14 am    Post subject: XMLNSC parser results in CHAR datatype only. Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri May 17, 2013 11:27 am    Post subject: Re: XMLNSC parser results in CHAR datatype only. Reply with quote

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
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Fri May 17, 2013 12:42 pm    Post subject: Reply with quote

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
View user's profile Send private message
kimbert
PostPosted: Fri May 17, 2013 1:43 pm    Post subject: Reply with quote

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
View user's profile Send private message
rekarm01
PostPosted: Fri May 17, 2013 2:11 pm    Post subject: Re: XMLNSC parser results in CHAR datatype only. Reply with quote

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
View user's profile Send private message
dogorsy
PostPosted: Fri May 17, 2013 10:07 pm    Post subject: Reply with quote

Knight

Joined: 13 Mar 2013
Posts: 553
Location: Home Office

set validation to contents and value in the input node.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
PostPosted: Sun May 19, 2013 5:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XMLNSC parser results in CHAR datatype only.
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.