[jdom-interest] Not parsing entities

Jason Hunter jhunter at collab.net
Thu Jun 21 13:20:56 PDT 2001

Call saxBuilder.setExpandEntities(false) and entities will not be
expanded.  They may be parsed (if the parser doesn't support the option
to avoid parsing) but JDOM will not add the content to the document and
will use an EntityRef instead.


Todd O'Bryan wrote:
> Is there any way to avoid parsing entities?
> I'm using JDOM with Xerces, and I tried setting up an EntityResolver that
> would just parse the entity as its name, but it doesn't seem to get called
> because the EntityResolver for the underlying SAXParser is what gets used.
>   (I used the setEntityResolver() method in SAXBuilder.) I suppose the
> thing to do would be to create a SAXParser, set its EntityResolver to my
> DoNothingResolver and then pass that to JDOM, but there's no SAXBuilder
> constructor that takes a SAXParser as an argument, they just take String
> names.
> This is apparently a common question on the Xerces-J list, but I've found
> no solutions there other than people suggesting changes in the input
> document (umm, the input document is the way it's supposed to be) or
> putting things in CDATA (but they're not CDATA, they're going to be parsed
> in a later pass).
> Any help much appreciated.
> Todd
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com

More information about the jdom-interest mailing list