[SAX] How to keep entities unresolved in the result ?
Hi there, I'm using Sax in Java to parse an XHTML document. Everything works fine, except that the entities found are always translated by the parser to their equivalent in the characters() method : & becomes & becomes space é becomes é This is fine, but how do I get the ref back ? I must in my case keep the existant otherwise I get errors in the XHTML generated. Moreover, depending of encoding issue, some entities such as ’ are translated to "?". I've set the encoding to ISO-8859-1, and didn't find which one to use to get back the ’ ... I found a way to get the entity (startEntity / endEntity) using my own handler for everything (DTD, Content, Error, lexical...), but it seems the characters() method is called after all entities contained between two elements are translated, so I don't know how to do what I want... I've searched the xml-dev archive, there was an old thread about this, but didn't end as I wanted it too :) http://lists.xml.org/archives/xml-dev/200005/msg00211.html I simply want to keep the #8217 or whatever was the entity, in the characters() method. Even more, if it's possible, I'd like not to resolve entities at all, cause I don't work with it and it's causing me more troubles than solutions (typical error is "Undefined entity..."). Thanks in advance, Aurelien
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format