I guess you use XMLNSC.CDataField to store the contents of the CData. If you want to add existing XML to this CData Field, you could convert it to BLOB (with the right CCSID and Encoding) and then set it.
If that doesn't work, you might want to try using ASBITSTREAM on the XML. But I must tell you that kimbert has warned against incorrect or unnecessary usuage of ASBITSTREAM. So use it only if you absolutely must.
sridhsri is correct.
- ASBITSTREAM to get a BLOB
- CAST to CHARACTER with the correct CCSID and encoding
- SET OutputRoot.XMLNSC.(XMLNSC.CDataField)myCDataField = myChars;
Quote:
But I must tell you that kimbert has warned against incorrect or unnecessary usuage of ASBITSTREAM. So use it only if you absolutely must.
Not quite. ASBITSTREAM is a very useful function.
I warned about unnecessary use of XMLNSC.Bitstream and XMLNSC.AsisElementContent. I prefer people to use the facilities provided by the parser if possible, because it's safer and more maintainable. This thread is a good example of what I mean. You *could* wrap CData tags around the XML string and then use XMLNSC.AsisElementContent. But why would you bother, when XMLNSC.CData is available?
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