Problems with XML and DTD usage

Martin v. Loewis martin at v.loewis.de
Thu May 30 03:19:36 EDT 2002


"Chris Prinos" <cprinos at foliage.com> writes:

> If I parse using validation, the validation takes place, but the
> resulting document contains an empty root node.

That looks like a bug in xmlproc; please report that to
sf.net/projects/pyxml.

> Shouldn't parsing with and without validation return the same
> document object (assuming it's valid to begin with)?

Not necessarily. In the specific case, the XML parsers used (xmlproc
and expat) have completely different code bases, so the behaviour is
easily different, as well.

> And shouldn't the non-validating parser maintain the doctype
> declaration in the resulting document instance (even if it's not
> used by the parser to validate the xml)?

Perhaps, but it just so happens that the underlying parser does not
report the doctype, so PyXML cannot record it. You may want to report
this as a bug for sf.net/projects/expat.

Regards,
Martin




More information about the Python-list mailing list