[jdom-interest] builder.setIgnoreDTD()

Elliotte Rusty Harold elharo at metalab.unc.edu
Wed Feb 6 07:59:23 PST 2002


Depending on the parser, there's normally a SAX property to turn this 
off without creating your own entity resolver. In Xerces it's 
http://apache.org/xml/features/nonvalidating/load-external-dtd

However, your suggestion does seem more likely to work across browsers.

On the other hand, here's what I very much don't like about using a 
custom EntityResolver: it will be called not just for the external 
DTD subset but also for any external entities referenced in the file 
such as &my_signature_file;. It will set the replacement text of 
these entities to the empty string and will not call the 
skippedEntity() method in ContentHandler. Thus we won't be able to 
transform them into JDOM EntityRef elements.

Which reminds me: SAXHandler doesn't handle skipped entity events 
now. I should fix that regardless of what we do with this proposal.

-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list