I don't believe their is anyway to do this. I don't think the JAXB runtime EVER calls writeCDATA of the Stax stuff. Most likely, you should just remove the "<[CDATA[" and tailing "]]>" parts of the string and just pass that. It will get escaped, but that SHOULD be OK.


Dan


On Jul 28, 2008, at 1:13 AM, adam_j_bradley wrote:


I have a parameter I want to populate with CDATA but I'm having trouble.
Currently the String is defined as

---snip---
String element = "!<[CDATA[<s:ppSoapHeader
xmlns:s=\"http://schemas.microsoft.com/Passport/SoapServices/SoapHeader \"
version=\"1.0\"><s:lcid>1033</s:lcid><s:sitetoken><t:siteheader
xmlns:t=\"http://schemas.microsoft.com/Passport/SiteToken\"; id=\"" + siteID
+ "\"/></s:sitetoken>" +
</s:ppSoapHeader>]]>";
---snip---

I wind up with
---snip---
!&lt;[CDATA[&lt;s:ppSoapHeader
xmlns:s="http://schemas.microsoft.com/Passport/SoapServices/ SoapHeader"version="1.0">&lt;s:lcid>1033&lt;/ s:lcid>&lt;s:sitetoken>&lt;t:siteheader
xmlns:t="http://schemas.microsoft.com/Passport/SiteToken";
id="253988"/>&lt;/s:sitetoken>&lt;/s:ppSoapHeader>]]&gt;
---snip---

But I want
---snip---
!<[CDATA[<s:ppSoapHeader
xmlns:s="http://schemas.microsoft.com/Passport/SoapServices/ SoapHeader"version="1.0"><s:lcid>1033</ s:lcid><s:sitetoken><t:siteheader
xmlns:t="http://schemas.microsoft.com/Passport/SiteToken";
id="253988"/></s:sitetoken><s:ppSoapHeader>]]>
---snip---

I don't want it to delimit the "<" with "&lt;", expecially the one before
the CDATA section!
Any ideas?

Thanks in advance!
Adam
--
View this message in context: 
http://www.nabble.com/Q%3A-Marshall-CDATA-tp18684232p18684232.html
Sent from the cxf-user mailing list archive at Nabble.com.


---
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog




Reply via email to