Bug in Elementtree/Expat

uche.ogbuji at gmail.com uche.ogbuji at gmail.com
Fri May 20 14:58:08 EDT 2005


"""
 > Most examples in the book do not include such a declaration and yet
are
> properly rendered by Internet Explorer.
> Is it mandatory and why is it that Expat crashes on it?

It's not mandatory but it's probably good practice to make the document
self-contained. The xlink prefix is defined in the DTD but Expat, as a
nonvalidating parser, won't fetch it.
"""

Important clarification:

The decision whether or not to read the external DTD subset is separate
from the decision whether or not to validate.  Expat does not validate,
but it does read the external subset, if you tell it to.  There are
other uses for reading the external subset, such as entity resolution.
And you can have validation constructs in the internal DTD subset (IOW
right in the XML source file itself), and expat will not do anything
with them because it does not validate.

This may seem a subtle distinction, but it lies behind a lot of user
confusion in practice.  The XML WG really should have simplified such
matters (IIRC SGML compatability was a big obstruction to doing so).

-- 
Uche
http://uche.ogbuji.net




More information about the Python-list mailing list