Author |
Message
|
jorro004 |
Posted: Sat Aug 25, 2007 10:00 pm Post subject: Question on Reading XML CDATA Structure |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Hi Masters,
Could you please advise on how can I use or code ESQL to extract XML Elements from CDATA Structure.Because from ESQL I couldnt extract just the XML Message from CDATA whereas it reads entire XML Structure from XML which I dont need.
Some thing like
<! CDATA
[
<? XML Vers
<!Doctyp...
<Message>
</Message>
]]
How can I access Message Element from CDATA sturcture please using ESQL?
Thanks in Advance
-Learner(Everything starts from Single Step to reach a MILE Stone ) |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Aug 26, 2007 7:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Easy: Parse the whole CDATA section into the Environment.
You can then walk the tree and find what you need.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jorro004 |
Posted: Mon Aug 27, 2007 9:35 am Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Thanks for the reply,
After Parsing, The CData elements were not read individually.
Though I try to extract just the elements of the CDATA, it displays entire structure lilke XML DECL and ALL.
Please advise, how can I extract just the required fields?
Like, I referenced them to Environment and then to a constant. Then by specifying Constant.(XML.Element),.
Thanks a bunch
-Learner(Everything Starts from a Single Step to complete a Mile Stone:) ) |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 27, 2007 10:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Please don't use the XML domain. Please use XMLNS or XMLNSC.
Please search around for other incidents of this same question - there's a very recent thread.
Please consider what 'parse' means, and look at the options on CREATE FIELD. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
jorro004 |
Posted: Tue Aug 28, 2007 9:40 am Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Thanks for the reply,
BTW, I Could able to look into recent post(Kumar4).
I also get the same Input message and need to convert to standard XML message within the CDATA.
But how can I access the attributes or elements using the XMLNS?
I was not able to navigate to the required element inside the CDATA after parsing. It treats entire message inside CDATA as a single element. Even though there are different elements inside it.
And also getting the same error as in the recent post using ATTACH statement.Please help me!
Thanks
- Learner |
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Aug 28, 2007 9:59 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi jorro004,
Please paste a file trace of the tree structure after you've managed the creation into the Environment....or atleast what you see in the debugger.
Only if we see your code can we have an idea of why things are not working...and about how to access attributes and elements in XMLNS please search this forum for snippets.
Regards. |
|
Back to top |
|
 |
jorro004 |
Posted: Tue Aug 28, 2007 10:44 am Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Hi..Thanks So much for your reply,
I'm working as below, Following are errors when I try to ATTACH CDATA from Input Message and also with out ATTACH statement.
Could you please let me know how can I work with for attaching CDATA Elements as Ouput Message which should be done dynamicaly
Last edited by jorro004 on Tue Aug 28, 2007 1:36 pm; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 28, 2007 1:04 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
STOP waisting our time.
You've been given the answer.
Extract the CDATA as BLOB.
CREATE lastchild of Environment.mycdata PARSE theblob.
Now you'll have a tree in the Environment.mycdata that you can navigate...
Otherwise you will need to use XSLT....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jorro004 |
Posted: Tue Aug 28, 2007 1:57 pm Post subject: |
|
|
Acolyte
Joined: 25 Aug 2007 Posts: 50
|
Hi,
Sorry for that, I was not able to understand it properly,
Anyways, The solution for my question was simple, The CDATA inside a XML Message cannot be navigate until it is parsed with BLOB.
Other Parser doesnt allow you to Navigate CDATA data.
Thanks for your time
-Learner |
|
Back to top |
|
 |
|