xml.dom - reading from a file

Alex Martelli aleax at aleax.it
Mon Nov 17 04:54:37 EST 2003


sashan wrote:

> Is the way to use DOM for an xml file as follows:
> 1) Read the file into a string
> 2) Call xml.dom.minidom.parseString(string)

It's one way, but xml.dom.minidom.parse(f) is generally better.  f can
be a filename OR a file object open for reading.


Alex





More information about the Python-list mailing list