Opening the file in XMLSpy (or any other viewer) generally causes an error though.  I am using the DOMWriter but I can’t save the XML file (and it won’t validate) with that “<” in the character data.

 

-----Original Message-----
From: Jesse Pelton [mailto:[EMAIL PROTECTED]
Sent: Monday, August 30, 2004 2:32 PM
To: [EMAIL PROTECTED]
Subject: RE: Less-than reserved character sanity check...

 

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