Author |
Message
|
gag_nm |
Posted: Sat Sep 21, 2013 3:31 am Post subject: Reading Data from XML |
|
|
Centurion
Joined: 16 Oct 2008 Posts: 102
|
HI ,
how i can read data from XML <a.b> using ESQL...
Code: |
<A>
<a.b>hello<a.b>
</A>
|
|
|
Back to top |
|
 |
Simbu |
Posted: Sat Sep 21, 2013 3:58 am Post subject: |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
|
Back to top |
|
 |
mqjeff |
Posted: Sat Sep 21, 2013 4:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
ESQL can only access the logical message tree.
It can't access XML. It can only access a logical message tree that is built from an XML document. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Sep 21, 2013 8:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
i believe the problem comes with the naming of the element...
ESQL says that if there is a conflict you need to enclose the name in double quotes.
So to access tag a.b you would need to do something like
Code: |
SET greeting= ref.A."a.b"; |
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
smdavies99 |
Posted: Sat Sep 21, 2013 10:00 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
fjb_saper wrote: |
i believe the problem comes with the naming of the element...
ESQL says that if there is a conflict you need to enclose the name in double quotes.
So to access tag a.b you would need to do something like
Code: |
SET greeting= ref.A."a.b"; |
Have fun  |
That is fine however the data shown in the original post is not valid XML. So is the "<a.b>hello world<a.b>" example a typo or the result of someone who does not know XML is designing data structures that are <redacted>? _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Sep 22, 2013 11:25 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
smdavies99 wrote: |
That is fine however the data shown in the original post is not valid XML. So is the "<a.b>hello world<a.b>" example a typo or the result of someone who does not know XML is designing data structures that are <redacted>? |
Indeed looks like I completely missed the missing slash. it should have said:
Code: |
<A>
<a.b>Hello</a.b>
</A> |
Thanks for picking that up smdavies99! _________________ MQ & Broker admin |
|
Back to top |
|
 |
aggarwal.intouch |
Posted: Tue Sep 24, 2013 1:27 am Post subject: |
|
|
 Acolyte
Joined: 30 May 2011 Posts: 56 Location: India
|
Use the following in your code:
OutputRoot.XMLNSC.Field= InputRoot.XMLNSC.A."a.b"; |
|
Back to top |
|
 |
|