[jdom-interest] entity references replacement

Sandro Böhme s.boehme at inovex.de
Fri Sep 28 04:19:11 PDT 2001


Hi,

first of all, thanks for all the responses. Special thanks to Todd for the
wrapper classes.
The solution is:
- setExpandEntities(false) does not work for Attributes.
- It is like Todd say: On the way in I have to change & to & to avoid
entity expansion.
    I use Todd's wrapper Reader class between the file and the SAXParser on
the way in.
- On the way out I need to overwrite the methods of the XMLOutputter:

  protected String escapeAttributeEntities(String s) {
    // because of the style entity references in the style attribute
    return s;
  }
  protected String escapeElementEntities(String s) {
    // for element content
    return s;
  }
Now it works!

Ciao,

Sandro




More information about the jdom-interest mailing list