Author |
Message
|
kathirvelt |
Posted: Sat Mar 12, 2011 4:08 pm Post subject: how to define ESQL with CDATA and dynamic xml in it. |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
How to define ESQL with CDATA and dynamic xml in it. Please advice.
<msgPayload><![CDATA[<clm
xmlns="http://test.com/xsd/iClmV0.2"> <versionId>00301</versionId>
<name>
<nmOrg>TEST DATA
</nmOrg>
</name></clm>]]>
</msgPayload> |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Mar 13, 2011 7:57 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
not enough data to give you specific advice.
Read up on the ASBITSTREAM function and the XML.CData and XMLNSC.CData field types.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kathirvelt |
Posted: Sun Mar 13, 2011 3:39 pm Post subject: |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
I'm using XMLNSC parser to define the xml. Can I do as mentioned below. Is this valid?
SET OutputRoot.XMLNSC.EMPRequest.msgsPayload.(XML.CDataSection) = ASBITSTREAM(OutputRoot.XMLNSC.message.empxml);
Thanks for your help. |
|
Back to top |
|
 |
mqjeff |
Posted: Sun Mar 13, 2011 4:18 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You can not write any ESQL code using the XMLNSC parser when you use any constants that do not start with XMLNSC.
So, no, you can not use XML.CData. And FJ should know this very very well.
Nor can you actually use XMLNSC.CData, because that's not actually the correct name of the correct constant. |
|
Back to top |
|
 |
kathirvelt |
Posted: Sun Mar 13, 2011 7:01 pm Post subject: |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
Can you please let me know how should I code in ESQL to get this in output xml. |
|
Back to top |
|
 |
kathirvelt |
Posted: Sun Mar 13, 2011 8:27 pm Post subject: |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
I was able to generat the output with the below one, But this is not the right way of doing this. Can someone suggest a good way of doing this.
SET OutputRoot.XMLNSC.EMPRequest.msgsPayload.(XML.CDataSection) ='[<clm
xmlns="http://test.com/xsd/iClmV0.2"> <versionId>00301</versionId>
<name>
<nmOrg>TEST DATA
</nmOrg>
</name></clm>'; |
|
Back to top |
|
 |
fjb_saper |
Posted: Sun Mar 13, 2011 9:48 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
@ Jeff At the time of my reply the OP had given absolutely no indication as to which parser he / she was using.
This why I said that he /she should READ up and look at BOTH the XML version and the XMLNSC version. As I instructed the OP to read up I did not think it necessary to do so myself... Note that despite your leading post and the big hint in it, the OP did not seem to be able to find the necessary reference...
@Kathirvelt:
Here is the Infocenter reference : XMLNSC: working with CData. A simple search on CData in the infocenter should have shown you this exemple.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Mar 14, 2011 1:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fjb_saper wrote: |
he /she should READ up and look at BOTH the XML version and the XMLNSC version. |
Don't use XML domain. At all. For anything. |
|
Back to top |
|
 |
kimbert |
Posted: Mon Mar 14, 2011 2:28 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
A simple search on CData in the infocenter should have shown you this exemple. |
I agree. I thought the same about this question: http://www.mqseries.net/phpBB2/viewtopic.php?t=56892
Please get into the habit of looking in the infocenter before asking for help on this forum. Or use the search button at the top of the page to look for similar questions. |
|
Back to top |
|
 |
kathirvelt |
Posted: Mon Mar 14, 2011 3:17 pm Post subject: |
|
|
Apprentice
Joined: 02 Oct 2010 Posts: 32
|
Thanks for you help/suggestions. I(he) did do the search on infocenter and here. But somehow missed to put correct keyword.
I was able to resolve the issue with follwoing.
DECLARE wholeMsgBlob BLOB ASBITSTREAM(OutputRoot.XMLNSC.empclm,OutputRoot.Properties.Encoding,OutputRoot.Properties.CodedCharSetId );
DECLARE wholeMsgChar CHAR CAST(wholeMsgBlob AS CHAR CCSID OutputRoot.Properties.CodedCharSetId); |
|
Back to top |
|
 |
|