[XML-SIG] PyXML Question

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri, 5 Oct 2001 20:02:19 +0200


> Are there any 'Introduction to PyXML' documents, describing the
> different parts and giving examples?  I have looked in the
> xml-howto.txt in /xmldocs, the section I think I need is 4.5
> Processing HTML, which contains 'Intro to HTML builder' :)

The XML HOWTO is the right starting point. However, that section still
needs to be written/updated/replaced. You should use a
xml.dom.ext.reader.Reader instance, and its from{Stream,Uri,String}
method.

Then, the normal DOM operations can be used on the tree. To write back
the result, you should use use xml.dom.ext.XHtmlPrettyPrint.

Note that processing HTML with XML libraries is always risky, as HTML
documents are not XML documents (unless they comply with XHTML);
often, they don't even comply with the HTML DTD. In these cases,
processors can easily get confused.

Regards,
Martin