Author |
Message
|
dilse |
Posted: Tue Nov 08, 2011 12:46 pm Post subject: Reading CDATA element with namespaces |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
Hi guys,
Message Broker version 7.0.0.2.
I have an XML with the following structure.
Code: |
<ns:Name xmlns:ns="http://www.example.org/Test">>
<ns:firstName>JOHN</ns:firstName>
<ns:lastName>DOE</ns:lastName>
<ns:address><![CDATA[<Address>
<StName>123 MAIN ST</StName>
<City>WORLD</City>
</Address>
]]></ns:address>
</ns:Name>
|
I am trying to get the CDATA field value in the compute node but I am having no luck.
Following are the ESQL statement that i tried but with no luck. But I was able to get the data file if the incoming XML doesnt have namespaces.
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC')
PARSE(InputRoot.XMLNSC.*:Name.Cdata.*:address);
|
I also tried the following but no luck.
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC')
PARSE(InputRoot.XMLNSC.*:Name.*:address);
|
Following is the Exception:
Code: |
Insert
Type:INTEGER:5
Text:CHARACTER:CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNSC' PARSE(InputRoot.XMLNSC.*:Name.Cdata.*:address);
RecoverableException
File:CHARACTER:F:\build\S700_P\src\DataFlowEngine\ImbRdl\ImbRdlTreeStatements.cpp
Line:INTEGER:177 Function:CHARACTER:SqlCreateFieldStatement::execute
Type:CHARACTER:ComIbmComputeNode
Name:CHARACTER:TEST_PROCESS#FCMComposite_1_2
Label:CHARACTER:TEST_PROCESS.Compute
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2906
Text:CHARACTER:
Insert
Type:INTEGER:5
Text:CHARACTER:.TEST_PROCESS_Compute.Main
Insert
Type:INTEGER:5
Text:CHARACTER:10.3
Insert
Type:INTEGER:5
Text:CHARACTER:NULL
Insert
Type:INTEGER:5
Text:CHARACTER:BITSTREAM
Insert
Type:INTEGER:5
Text:CHARACTER:CREATE
Insert
Type:INTEGER:5
Text:CHARACTER:CHARACTER, BIT, BLOB
Insert
Type:INTEGER:5
Text:CHARACTER:NULL
|
Any idea is appreciated.[/code] |
|
Back to top |
|
 |
kimbert |
Posted: Tue Nov 08, 2011 12:59 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Type 'XMLNSC CDATA' into the info center. It's all explained there. |
|
Back to top |
|
 |
dilse |
Posted: Wed Nov 09, 2011 7:54 am Post subject: |
|
|
 Master
Joined: 24 Jun 2004 Posts: 270
|
Thanks kimbert. I already went through the documentation before I posted this but I did not have any luck with finding the documentation regarding the readign of CDATA elements involving namespaces anywhere.
Any pointers are appreciated... |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 09, 2011 8:15 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
This is not about namespaces - it's about understand what the message tree looks like, and how to access fields in it. I don't want to sound like a gramophone with the needle stuck, but...I suggest that you put in a Trace node and take a user trace. I'm almost certain that you will find the problem by doing that. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Nov 09, 2011 8:35 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
kimbert wrote: |
This is not about namespaces - it's about understand what the message tree looks like, and how to access fields in it. I don't want to sound like a gramophone with the needle stuck, but...I suggest that you put in a Trace node and take a user trace. I'm almost certain that you will find the problem by doing that. |
A.K.A known as 'Kimbert's 2nd rule'...  _________________ 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 |
|
 |
|