Author |
Message
|
MBLearner |
Posted: Thu Jan 26, 2006 3:15 pm Post subject: Accessing CWRSD values |
|
|
Novice
Joined: 20 Jan 2006 Posts: 23
|
I have an JDBC adapter error xml message as follows:
<?xml version="1.0" encoding="UTF-8"?>
<?CWRSD status="-1" description="[Type: Error] [MsgID: 37000] [Mesg: A SQL Exception java.sql.SQLException: No more data to read from socket occurred] "?>
<QAD_PT_MSTR:QAD_PT_MSTR xmlns:QAD_PT_MSTR="..">
..
..
..
</QAD_PT_MSTR:QAD_PT_MSTR>
In the message flow i need to access the values of the CWRSD elements using the ESQL. More specifically, I need to access the value of "description" of CWRSD. How can i access that.
Thanks in advance |
|
Back to top |
|
 |
JT |
Posted: Thu Jan 26, 2006 7:14 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
|
Back to top |
|
 |
MBLearner |
Posted: Thu Jan 26, 2006 7:49 pm Post subject: |
|
|
Novice
Joined: 20 Jan 2006 Posts: 23
|
Thanks for the reply.
The link what you have mentioned is for accessing normal XML elements or attributes. But here I would like to access CWRSD which is within the symbol <? ?> ie, This element is not the normal element and it can not be accessed by InputRoot.XML.(XML.Element)CWRSD.(XML.Attribute)description. It is more similar to XML declaration statement. How to access elements if the element is wrapped within <? and ?> symbols (CWRSD in this case)
<?xml version="1.0" encoding="UTF-8"?>
<?CWRSD status="-1" description="[Type: Error] [MsgID: 37000] [Mesg: A SQL Exception java.sql.SQLException: No more data to read from socket occurred] "?>
<QAD_PT_MSTR:QAD_PT_MSTR xmlns:QAD_PT_MSTR="..">
..
..
..
</QAD_PT_MSTR:QAD_PT_MSTR> |
|
Back to top |
|
 |
shanson |
Posted: Fri Jan 27, 2006 5:58 am Post subject: |
|
|
 Partisan
Joined: 17 Oct 2003 Posts: 344 Location: IBM Hursley
|
As CWRSD is an XML Processing Instruction (PI), try:
CHAR Result = InputRoot.XML.(XML.ProcessingInstruction)CWRSD;
This will return the content of the PI as a string which you will then have to take apart manually. |
|
Back to top |
|
 |
MBLearner |
Posted: Fri Jan 27, 2006 8:58 am Post subject: |
|
|
Novice
Joined: 20 Jan 2006 Posts: 23
|
Thank you very much. It's now working.
Happy Learning !! |
|
Back to top |
|
 |
sunilagarwal.1982 |
Posted: Thu May 07, 2009 5:46 pm Post subject: |
|
|
 Novice
Joined: 04 May 2009 Posts: 20
|
I also need to access the value of Status and description attribute.
Using the below code :
CHAR Result = InputRoot.XML.(XML.ProcessingInstruction)CWRSD;
Result = 'status="0" description="null"'
Result_1 = 'status="-1" description="**** ERROR : Invalid class name passed to createHandler:"'
Please let me know how I can apart the value of status and description attribute.
I tried to use Result.status but it doesn't work. |
|
Back to top |
|
 |
smdavies99 |
Posted: Thu May 07, 2009 10:58 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
The obvious question is:-
Why are you using the depreciated XML Parser? _________________ 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 |
|
 |
Vitor |
Posted: Fri May 08, 2009 12:30 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
smdavies99 wrote: |
Why are you using the depreciated XML Parser? |
This is a double post of this where you'll find your question answered.
It seems the poster believes that if the same question is asked often enough, sooner or later the answer will change.....  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|