ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Accessing CWRSD values

Post new topic  Reply to topic
 Accessing CWRSD values « View previous topic :: View next topic » 
Author Message
MBLearner
PostPosted: Thu Jan 26, 2006 3:15 pm    Post subject: Accessing CWRSD values Reply with quote

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
View user's profile Send private message
JT
PostPosted: Thu Jan 26, 2006 7:14 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Click here
Back to top
View user's profile Send private message
MBLearner
PostPosted: Thu Jan 26, 2006 7:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
shanson
PostPosted: Fri Jan 27, 2006 5:58 am    Post subject: Reply with quote

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
View user's profile Send private message
MBLearner
PostPosted: Fri Jan 27, 2006 8:58 am    Post subject: Reply with quote

Novice

Joined: 20 Jan 2006
Posts: 23

Thank you very much. It's now working.

Happy Learning !!
Back to top
View user's profile Send private message
sunilagarwal.1982
PostPosted: Thu May 07, 2009 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
smdavies99
PostPosted: Thu May 07, 2009 10:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Fri May 08, 2009 12:30 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Accessing CWRSD values
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.