#126 ajax:displaytag problem on parsing special characters


I'm using ajax:displaytag and I think there is a conflict between the way displaytag tags generate the output and the way ajaxtag parse it:
If the content of a dsiplaytag column contains some special characters, they are unescaped (ex 'é').

But the ajaxtag parser doesn't have the entity 'é" defined, so I've got the next exception:

org.xml.sax.SAXParseException: The entity "eacute" was referenced, but not declared.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at net.sourceforge.ajaxtags.helpers.XMLUtils.getXMLDocument(XMLUtils.java:116)
at net.sourceforge.ajaxtags.tags.AjaxAnchorsTag.getDocument(AjaxAnchorsTag.java:134)
at net.sourceforge.ajaxtags.tags.AjaxDisplayTag.processContent(AjaxDisplayTag.java:115)
at net.sourceforge.ajaxtags.tags.AjaxAreaTag.doEndTag(AjaxAreaTag.java:116)

Is it a way to solve it?


  • Jens Kapitza

    Jens Kapitza - 2010-03-10
    • assigned_to: nobody --> jenskapitza
  • Jens Kapitza

    Jens Kapitza - 2010-03-10

    i think the only way to solve it is to enable XHMTL.DTD in the java xml-parser.
    but at the moment i've no idea how to do it.

  • Jens Kapitza

    Jens Kapitza - 2010-03-10

    last comment for today try to use CDATA to avoid parsing.

  • cristi

    cristi - 2010-03-11

    The problem I see is that the tag is very unflexible to parse the XML:

    If the content of the XML is HTML escaped (using StringEscapeUtils, by instance), ther is no way to tell to the tag which entityResolver to use.

    The tag will instantiate internaly the DocumentBuilder and try to parse the internal content. No option is exposed to the user. More, because usually the internal content of this tag is a valid HTML text, the parser should, by default, use an EntityResolver which is able to resolve HTML4 entities. (http://www.w3.org/TR/html4/sgml/entities.html)

    But anyway, there should be a way to customize the parser for the tag..

    Thank you for your posts :)


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks