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 » Parse XML string as MB tree

Post new topic  Reply to topic
 Parse XML string as MB tree « View previous topic :: View next topic » 
Author Message
francoisvdm
PostPosted: Thu Sep 27, 2007 12:54 am    Post subject: Parse XML string as MB tree Reply with quote

Partisan

Joined: 09 Aug 2001
Posts: 332

MB V602, windows platform:

I'm trying to parse a string out as tree in MB - is it possible?

Here is my code:

Code:
SET OutputRoot.XML.MyData = '<NAME><FIRST>Francois</FIRST><SECOND>xxx</SECOND></NAME>';
       
        DECLARE creationPtr REFERENCE TO OutputRoot;
        DECLARE bodyBlob2 BLOB ASBITSTREAM(OutputRoot.XML.MyData
         OPTIONS FolderBitStream
         ENCODING InputProperties.Encoding
         CCSID InputProperties.CodedCharSetId
         );
       CREATE LASTCHILD OF creationPtr DOMAIN('XMLNS') PARSE(bodyBlob2,
                                     InputProperties.Encoding, InputProperties.CodedCharSetId);


... but alas, the value in XMLNS.MyData stays as a string and not nicely parsed as a tree. Any advice please .... ? For the attentive readers, this is part of my "webMethods" problem.

Thanks all
_________________
If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.

Francois van der Merwe
Back to top
View user's profile Send private message Send e-mail
francoisvdm
PostPosted: Thu Sep 27, 2007 1:34 am    Post subject: Reply with quote

Partisan

Joined: 09 Aug 2001
Posts: 332

OK, this seems to work, not creating blobs or anything - I new I had a blond moment.

Code:
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNS') PARSE(OutputRoot.XML.MyData CCSID 1208 ENCODING MQENC_NATIVE );

_________________
If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.

Francois van der Merwe
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Thu Sep 27, 2007 2:09 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Happy you solved it.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Cogito-Ergo-Sum
PostPosted: Wed May 15, 2013 9:47 am    Post subject: Reply with quote

Master

Joined: 07 Feb 2006
Posts: 293
Location: Bengaluru, India

Suppose, there was a mechanism to have the CREATE...PARSE statement to automatically pick up encoding from the XML declaration of the input document. That would make parsing truly generic.
_________________
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 » Parse XML string as MB tree
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.