|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Fetch specific XML Fields |
« View previous topic :: View next topic » |
Author |
Message
|
nmartinho |
Posted: Sat Apr 05, 2008 3:45 am Post subject: Fetch specific XML Fields |
|
|
Newbie
Joined: 03 Jul 2003 Posts: 4 Location: Lisbon, Portugal
|
Hi everybody,
I have XML messages (with transactions) that i receive from a BizTalk to a iSeries destination.
I'm having difficulties to fetch some information from the XML content, on a Compute Node.
I'm using the XMLNC parser.
An example, of the input:
(0x01000000):XMLNSC = (
(0x01000400):XmlDeclaration = (
(0x03000100):Version = '1.0'
(0x03000100):Encoding = 'ibm850'
)
(0x01000000)urn:bancobpn.kanalo.SvcA_GB5400_CS017.input:Adapter = (
(0x03000102)http://www.w3.org/2000/xmlns/:ns0 = 'urn:bancobpn.kanalo.SvcA_GB5400_CS017.input'
(0x01000000):Header = (
(0x03000000):tptrs = 'GB5400'
(0x03000000):chave = '000000000000347717'
(0x03000000):parmsg = '1'
)
(0x01000000):Body = (
(0x03000000):ccdopgmc = 'GB5400'
(0x03000000):ccdottr = 'CS017'
(0x03000000):ccdojobnc = 'ATXTST2'
(0x03000000):ccdouserc = 'ATX002TST'
(0x03000000):ccdopgmqc = ' '
(0x03000000):ccdorcode = '0'
(0x03000000):ccdoestr = '1'
(0x03000000):ccdoaptr = 'A'
(0x03000000):ccdohcli = '2'
(0x03000000):ccdovncr = 'N'
(0x03000000):ccdopnome = 'S'
(0x03000000):ccdoncli = '001430304'
(0x03000000):ccdonatr = '10'
(0x03000000):ccdonseq = '001'
(0x03000000):ccdoice01 = '0'
)
)
The namespace line is always changing, is not fixed.
How can i extract information from some fields above like 'tprts' and 'chave'?
I'm going to save that information in a db2 table, but that i know how to do.
Thanks for your help |
|
Back to top |
|
 |
elvis_gn |
Posted: Sat Apr 05, 2008 4:29 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi nmartinho,
Can you please paste a sample XMLNS rather than the tree in trace, I see too many ':' and am confused which is the namespace and which not
But the logic would be to use a '*' where the namespace has to occur...for example *:Field.*:Field.
Regards. |
|
Back to top |
|
 |
nmartinho |
Posted: Sat Apr 05, 2008 5:23 am Post subject: |
|
|
Newbie
Joined: 03 Jul 2003 Posts: 4 Location: Lisbon, Portugal
|
This is the XML message:
<?xml version="1.0" encoding="ibm850"?><ns0:Adapter xmlns:ns0="urn:bancobpn.kanalo.SvcA_GB5400_CS017.input"><Header><tptrs>GB5400</tptrs><chave>000000000000347717</chave><parmsg>1</parmsg></Header><Body><ccdopgmc>GB5400</ccdopgmc><ccdottr>CS017</ccdottr><ccdojobnc>ATXTST2</ccdojobnc><ccdouserc>ATX002TST</ccdouserc><ccdopgmqc> </ccdopgmqc><ccdorcode>0</ccdorcode><ccdoestr>1</ccdoestr><ccdoaptr>A</ccdoaptr><ccdohcli>2</ccdohcli><ccdovncr>N</ccdovncr><ccdopnome>S</ccdopnome><ccdoncli>001430304</ccdoncli><ccdonatr>10</ccdonatr><ccdonseq>001</ccdonseq><ccdoice01>0</ccdoice01></Body></ns0:Adapter>
This is from the Input node.
I also, don't want to make changes to the formatting of the message, when he goes to the output node.
Thanks. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Apr 05, 2008 6:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Well, the interesting thing is that your lower level elements aren't namespace qualified.
So you should be able to use something like
Code: |
InputRoot.XMLNSC.*:Adapter.Header.tptrs |
_________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
nmartinho |
Posted: Sun Apr 06, 2008 12:18 am Post subject: |
|
|
Newbie
Joined: 03 Jul 2003 Posts: 4 Location: Lisbon, Portugal
|
It worked
I have tried several ways to do this in the past days, but none worked.
Thanks for all the support. |
|
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
|
|
|
|