|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Question on xpath |
« View previous topic :: View next topic » |
Author |
Message
|
Arya |
Posted: Mon Aug 11, 2014 10:47 pm Post subject: Question on xpath |
|
|
Newbie
Joined: 11 Aug 2014 Posts: 2
|
Hi All,
I am getting xpath from database as character. I want to retrieve that element from XML. Since the xpath is character , I am not able to retrieve the element from XML. Is any way to convert the character to refer the XML?
For example, my xml is
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
</book>
<diary>
<abc>* please do not use *</abc>
</diary>
</catalog>
and I get the path catalog.book from database as character. I want to retrieve element book for further processing. But since catalog.book is character, I am not able to retrieve the element. Please suggest a method for doing this. |
|
Back to top |
|
 |
MB Developer |
Posted: Tue Aug 12, 2014 5:01 am Post subject: |
|
|
 Disciple
Joined: 03 Feb 2014 Posts: 179
|
Hi Arya,
once refer below link,I believe it will be help for you
link _________________ Thanks.... |
|
Back to top |
|
 |
Arya |
Posted: Wed Aug 13, 2014 1:58 am Post subject: |
|
|
Newbie
Joined: 11 Aug 2014 Posts: 2
|
Thanks for the reply.
But my issue is not regarding inserting into DB. Its regarding retrieving the node using data from db.
Below is the issue.
I am using a similar query to retrieve data from XML in ESQL.
Set EV.resultset=select A.B from InputRoot.XMLNSC;
Since I retrieve A.B from cache , I am getting it as character. So the above query is not working as expected. Please give suggestions.
Thanks in advance. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Aug 13, 2014 2:28 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
ESQL field reference != XPath expression
If the XPath is very,very simply then you may be able to replace / with . and get the correct result. But in my opinion that's a risky technical solution.
The JavaCompute node can execute an XPath expression against the message tree and return a result set. Maybe you can get a more robust solution that way? _________________ Before you criticize someone, walk a mile in their shoes. That way you're a mile away, and you have their shoes too. |
|
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
|
|
|
|