|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Parse XML string as MB tree |
« View previous topic :: View next topic » |
Author |
Message
|
francoisvdm |
Posted: Thu Sep 27, 2007 12:54 am Post subject: Parse XML string as MB tree |
|
|
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 |
|
 |
francoisvdm |
Posted: Thu Sep 27, 2007 1:34 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Thu Sep 27, 2007 2:09 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Happy you solved it.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Cogito-Ergo-Sum |
Posted: Wed May 15, 2013 9:47 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|