Author |
Message
|
francoisvdm |
Posted: Wed Jul 01, 2009 7:24 am Post subject: parsing XMLNSC leaving out one level |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
MB 6.1 on XP
I've got XML data coming into MQ Input node (set as blob) and later in the flow I need to parse the data into XMLNSC. I use the following code:
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNSC' PARSE(InputRoot.BLOB.BLOB
ENCODING InputRoot.Properties.Encoding
CCSID InputRoot.Properties.CodedCharSetId
SET 'MyMsgSet'); |
After parsing the tree looks like:
OutputRoot->XMLNSC->TopLevel->Field1,Field2 etc
I would like it to look like OutputRoot->XMLNSC->Field1,Field2 etc
in other words I want to leave out the top level element.
Is there an easy way to do this either during parsing or after parsing. Note, there is MANY fields under the TopLevel, so I would prefer to keep memory actions down to a minimum...heavily used flow.
Also note, the parse is from a blob.
Thank you...ALL comments welcome...tired on this side trying to change the code. _________________ 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 |
|
 |
mqjeff |
Posted: Wed Jul 01, 2009 7:44 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Multiple-rooted documents are not legal XML. |
|
Back to top |
|
 |
francoisvdm |
Posted: Wed Jul 01, 2009 8:18 am Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
ok...valid point. When I parse to MRM...then I get error RM Worker not found....but as far as I can see the message set is there...in fact, when I use RCD node it parses ok to MRM. In this parse the "TopLevel" element is not there. _________________ 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: Wed Jul 01, 2009 8:46 am Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
Sorry...above msg not valid...late here...did not supply type for MRM parsing _________________ 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 |
|
 |
mqjeff |
Posted: Wed Jul 01, 2009 10:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
There is a significant difference between MRM-XML and all of the other XML parser. The MRM parser "eats" the root element and subsumes that such that you never use it in MB element paths. All other parsers do not do this, and you must use the Root element name in all of your MB element paths.
Don't use MRM-XML. Don't use XML. Use XMLNSC. And always use the root element name. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Jul 01, 2009 2:09 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Just in case the message gets lost in the noise...everything mqjeff said was 100% correct. |
|
Back to top |
|
 |
|