Hi all,

I'm new to the list and just started using Castor. I'm impressed so far but I've run into a problem. The party who has defined the XML document demands that all values be wrapped in CDATA. Right now, I am marshalling the object with Castor and then hacking the document by calling getElementsByTagName(), pulling the value, creating a CDATA section, removing the element's child, and appending the new CDATA section. It would be cool if I could get the value wrapped in CDATA automatically during the marshalling. I tried writing a GeneralizedFieldHandler that would wrap the value like

value = "<![CDATA[" + value + "]]>";

but that is so wrong and the first "<" gets escaped. I've look around and tried lots of different things but I have been entirely unsuccessful. Can anyone point me in the right direction to do this? Is it possible or is my hack not really a hack so I should change my method name from hackDocument() to fixUpDocument()? :)

Thanks a lot
Marc

-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to