[jdom-interest] SAXBuilder bug w.r.t internal DTD subset
Elliotte Rusty Harold
elharo at metalab.unc.edu
Fri Apr 12 12:32:33 PDT 2002
>Is there any reason to preserve the internal subset, if entities are
>expanded? My thinking was that the don't-expand-entities flag was really a
>preserve-round-trip flag. If you want to be able to round-trip the document,
>then you want to preserve the internal subset and not expand entities.
>Otherwise, if you only care about the data values, then you expand entities,
>and there's no real reason to preserve the internal subset (so you might as
>well not remember it, for performance reasons). Does this make any sense?
>
1. Why would you not preserve it if you could?
2. Yes, when the document comes out the other end we may want it to
be as valid or invalid as it was when it went in, or at least to be
able to be validated against the same DTD. You can't do this without
the internal DTD subset.
You could argue that JDOM is a pure document body API, but that would
indicate that we should throw away the DOCTYPE declaration
completely, which we don't do.
Entoty references are really a separate case. Entities are about the
physical structure of the XML document. DTDs (Internal and external
subsets) are part of the logical structure of the document, or
perhaps arguably the meta-info of the document. Whether a program
preserves entity references is really a separate question from what
it does with ELEMENT and ATTLIS declarations in the internal DTD
subset.
--
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| The XML Bible, 2nd Edition (Hungry Minds, 2001) |
| http://www.cafeconleche.org/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.cafeconleche.org/ |
+----------------------------------+---------------------------------+
More information about the jdom-interest
mailing list