|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
XMLNSC.CDataField |
« View previous topic :: View next topic » |
Author |
Message
|
p.cradwick |
Posted: Mon Jul 23, 2007 9:46 pm Post subject: XMLNSC.CDataField |
|
|
Acolyte
Joined: 16 May 2001 Posts: 56
|
Hi,
I am creating XML with a CDATA section and until recently I was using XML.CDATASection to do this, but then
changed it to XMLNSC.CDataField when I needed to output namespace xml in this field and got an error using XML.
However the XMLNSC.CDATASection seems to cause the generation of a NULL tag which does not validate,
neither in XMLSpy nor in MQInput node on trying to read the message written to a queue.
During testing I created both CDATA sections using both XMLNSC and XML e.g.:
SET excRef.MessageDetails.MessageDomain = 'XMLNSC';
CREATE LASTCHILD OF OutputLocalEnvironment.InputMsg DOMAIN('XML') PARSE(ASBITSTREAM(InputRoot.XMLNSC));
SET excRef.MessageDetails.MessageData[1].(XMLNSC.CDataField) = CAST(ASBITSTREAM(OutputLocalEnvironment.InputMsg.XML) AS CHAR CCSID 437);
SET excRef.MessageDetails.MessageData[2].(XML.CDataSection) = CAST(ASBITSTREAM(OutputLocalEnvironment.InputMsg.XML) AS CHAR CCSID 437);
Traces from both sides on the MQOutput node are identical and show:
(0x01000000):MessageDetails = (
(0x03000000):MessageDomain = 'XMLNSC'
(0x01000000):MessageData = (
(0x03000001): = '<?xml version="1.0" encoding="UTF-8"?><methodCall>...</methodCall>'
)
(0x01000000):MessageData = (
(0x02000001): = '<?xml version="1.0" encoding="UTF-8"?><methodCall>...</methodCall>'
This gave rise to the output (as viewed in RFHUtil):
<MessageDetails>
<MessageDomain>XMLNSC</MessageDomain>
<MessageData>
<><![CDATA[<?xml version="1.0" encoding="UTF-8"?><methodCall>...</methodCall>]]></>
</MessageData>
<MessageData><![CDATA[<?xml version="1.0" encoding="UTF-8"?><methodCall>...</methodCall>]]></MessageData>
</MessageDetails>
The extra "<>" and "</>" on the XMLNSC.CDataField are not valid xml. It looks like an extra outer tag is being
generated with null tag name!
Has anyone seen this before and found a solution??
Peter |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 24, 2007 1:44 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Type expressions go BEFORE the field name.
So when you say "MessageData[1].(XMLNSC.CDataField)", you are saying "Create an anonymous child of MessageData[1], that is a CDataField"
I think you want "(XMLNSC.CDataField)MessageData[1]" instead. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
p.cradwick |
Posted: Tue Jul 24, 2007 12:40 pm Post subject: XMLNSC.CDATAFIELD |
|
|
Acolyte
Joined: 16 May 2001 Posts: 56
|
Thanks Jeff,
I was assuming that the XMLNSC CDATA worked the same way as XML.
The follwing code
SET excRef.MessageDetails.MessageDomain = 'XMLNSC';
CREATE LASTCHILD OF OutputLocalEnvironment.InputMsg DOMAIN('XML') PARSE(ASBITSTREAM(InputRoot.XMLNSC));
SET excRef.MessageDetails.(XMLNSC.CDataField)MessageData1 = CAST(ASBITSTREAM(OutputLocalEnvironment.InputMsg.XML) AS CHAR CCSID 437);
SET excRef.MessageDetails.MessageData2.(XML.CDataSection) = CAST(ASBITSTREAM(OutputLocalEnvironment.InputMsg.XML) AS CHAR CCSID 437);
produced this xml
<MessageDomain>XMLNSC</MessageDomain>
<MessageData1><![CDATA[<?xml version="1.0" encoding="UTF-8"?><methodCall>...</methodCall>]]></MessageData1>
<MessageData2><![CDATA[<?xml version="1.0" encoding="UTF-8"?><methodCall>...</methodCall>]]></MessageData2>
Maybe the different behaviour is why the name has changed from CDATASection to CDATAField...
Peter |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 24, 2007 3:03 pm Post subject: Re: XMLNSC.CDATAFIELD |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
p.cradwick wrote: |
I was assuming that the XMLNSC CDATA worked the same way as XML. |
In this respect, it does.
You need to put "(XML.CDATASection)" in front of the field identifier in XML, just like you need to put "(XMLNSC.CDATAField)" in front of the field identifier in XMLNSC.
It's naught to do with your domain. It's all to do with your code...  _________________ I am *not* the model of the modern major general. |
|
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
|
|
|
|