Assuming you're letting Xerces do the serialization (by using DOMWriter, for instance), just include '<' in your character data. Xerces translates characters into the corresponding character entities as needed.


From: Styduhar, Chris [mailto:[EMAIL PROTECTED]
Sent: Monday, August 30, 2004 3:16 PM
To: [EMAIL PROTECTED]
Subject: Less-than reserved character sanity check...

I have an XML file which needs to have a “<” (less than) character in a data field.  I have put the less-than character in the XML as “&lt;” which is how I’ve always done it.  However – after Xerces parses the document, the string is transformed into “lt;”… and the rest of my software doesn’t handle that.  Have I lost my mind?  How am I supposed to encode greater than and less than symbols?

 

Thanks,

Chris

 

Reply via email to