[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:

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

Mit freundlichen Grüßen,
Best Regards,
River


-----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

hi
	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

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

	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?

regards
niroshan


	
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@you
rhost.com




More information about the jdom-interest mailing list