Claude Vedovini wrote:
Hi Bo,You are right, I get the entities version, but that is not what I want. I want the xml from the string to be part of the xml document, that is it should not be treated like character data. Is this possible?
This is quite normal in fact, when you do it like that the tags in the <body> decomes part of your xml and if you were validating against a DTD or a Schema there are some chances that it would not validate because the <body> element would certainly be of CDATA type.
What you have to do is to precise that the contained string is not XML.
You can do it in two maners;
- Or you are using entities and this will give you the following:
<body>
<p>The body of the <b>news</b></p>
</body>
Castor will resolve the entities when unmarshalling and you will get the correct string
- Or you use a CDATA section (http://www.w3.org/TR/2000/REC-xml-20001006#sec-cdata-sect), like that:
<body><![CDATA[
<p>The body of the <b>news</b></p>
]]></body>
It is more human-readable, but I think that if you marshall it again with Castor you will finally get the "entities" version
Thank you for you answer, and I am sorry if my first mail did not specify my goal clearly.
--
Bo Gundersen
DBA/Software Developer
M.Sc.CS.
www.atira.dk
----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev
