parsing multiple root element XML into text

Alain Ketterlin alain at dpt-info.u-strasbg.fr
Fri May 9 05:51:39 EDT 2014


Percy Tambunan <percy.tambunan at gmail.com> writes:

> Hai, I would like to parse this multiple root element XML 
>
> <object class="EnumDnSched">
[...]
> </object>
> <object class="EnumDnSched">
[...]
> </object>

Technically speaking, this is not a well-formed XML document (it is a
well-formed external general parsed entity, though). If you have other
XML processors in your workflow, they will/should reject it.

The easiest fix is to wrap this inside a root element (see other
messages in this thread), or use a DTD-declared entity to include this
fragment in a document.

-- Alain.



More information about the Python-list mailing list