I've spent all day trying to find out how to replace characters with entity references and have had no luck. I don't even want to use custom entity references, just &amp, &lt, and &gt so the parser won't choke reading what I'm outputting.
 
One would think that the Text node setText/getText methods would take care of it (or at least throw an exception if you give it characters that will break the parser), but it doesn't.
 
How do I convert a Java String from raw characters to an XML-safe representation?
 
Thanks for any help,

Mark R. Sizer,
CyberCrop.com

P.S. Is this as easy as I think it should be and I'm just really stupid today? Meanwhile, I'm going to write the code myself.

Reply via email to