Lists Home |
Date Index |
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 é
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 :)
I simply want to keep the #8217 or whatever was the entity, in the
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,