You could always try escaping the special characters. So doing this
element.addText( "<]]>"" );
That could then quite happily pass through XML processing quite happily,
then if you want it to appear back as <]]>" again you could unescape the
special characters again. e.g. if you were to view the markup in a HTML
browser it would look like <]]>"
James
----- Original Message -----
From: "Silvain Piree" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 08, 2002 7:57 AM
Subject: [dom4j-user] how to store text <]]>" ??
> Hi,
>
> I need to store the text <]]>" in an XML file.
>
> I can't store it as attribute because it contains " character.
> I can't store it as text because it contains < and > characters.
>
> So i tried to store it as CDATA, but it seems that the ]]> characters
> are not allowed in CDATA, as these are used as end-marker.
>
> So, following doesn't work:
>
> document.addElement("a").addCDATA("<]]>\"");
>
> .... save document ....
> .... load document .... => fatal load error
>
> Does anyone have a suggestion how to solve this problem??
>
> Silvain
>
> p.s. above string is a simplified example of what's really happening,
> but above describes the basic problem.
>
>
>
> _______________________________________________
> dom4j-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dom4j-user
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user