Parse XML using Python

Uche Ogbuji uche at
Fri Dec 10 16:22:37 CET 2004

This is a neat solution.  You can parse any well-formed general
entitity (e.g. Anil's document with multiple root nodes) in 4Suite

from Ft.Xml.Domlette import EntityReader
s = """
<spam2>more eggs</spam2>
docfrag = EntityReader.parseString(s, 'http://foo/test/spam.xml')

docfrag is now ready for processing using DOM methods.

Uche Ogbuji                                    Fourthought, Inc.
Use CSS to display XML -
Location, Location, Location -
The State of Python-XML in 2004 -
Be humble, not imperial (in design) - and more XML Hacks -
A survey of XML standards -

More information about the Python-list mailing list