|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Extract CDATA Value from XML |
« View previous topic :: View next topic » |
Author |
Message
|
viswasg |
Posted: Fri Feb 11, 2005 11:06 am Post subject: Extract CDATA Value from XML |
|
|
Novice
Joined: 15 Oct 2003 Posts: 10
|
Hi,
I am trying to extract CDATA value from XML, wherein I want only the value in the CDATA to be retrieved. In the following XML
<?xml version="1.0" encoding="UTF-8"?>
<Test>
<CTag><![CDATA[Test & Test]]></CTag>
</Test>
I want to extract only "Test & Test".
When I use InputRoot.XML.Test.CTag.(XML.CDataSection), I am getting the output as <![CDATA[Test & Test]]>, but I want only "Test & Test" to be retrived.
Could anyone of you let me know how to acheive this using ESQL?
Thanks in advance.
rgds,
Viswas |
|
Back to top |
|
 |
jefflowrey |
Posted: Sat Feb 12, 2005 8:54 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Did you try using the VALUE clause? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
viswasg |
Posted: Mon Feb 14, 2005 3:08 pm Post subject: |
|
|
Novice
Joined: 15 Oct 2003 Posts: 10
|
Hi Jeff,
I havent tried using VALUE, but found the solution.
We need to cast the parsing xml value to character i.e,
CAST(InputRoot.XML.Test.CTag AS CHARACTER).
This would retrieve only Test & Test from CDATA.
Anyways, thanks for the help.
rgds,
Viswas |
|
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
|
|
|
|