[jdom-interest] escape characters within a element text

River river at verat.net
Tue Sep 30 17:32:38 PDT 2003

You can try to wrap it up inside CDATA sections, ex:

  <description><![CDATA[height of jack is < 6 feet]]></description>

Mit freundlichen Grüßen,
Best Regards,

-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]
On Behalf Of Niroshan
Sent: Tuesday, September 30, 2003 3:31 PM
To: jdom-interest at jdom.org
Subject: [jdom-interest] escape characters within a element text

	if i have a string which is a xml, but contains invalid
characters within the elements text, how can i create a xml document out
of it. 
	If the string is as below

		<name>jack </name>
		<description> height of jack is < 6 feet </description>

	here the description text contains the character '<', so if we
try to create a dom document using the SAXBuilder it gives an exception.
Is there a way in JDOM to say replace those characters with the required
escape characters?

	before creating the dom document?


To control your jdom-interest membership:

More information about the jdom-interest mailing list