Parsing xml file using python

David LeBlanc whisper at oz.net
Thu Mar 4 20:09:13 EST 2004


 
> Hello, all,
> 
> I am new to Python.
> 
> I need to read an XML document and ignore all XML tags and write only
> those between the tags to a text file.  In other words, if I have an
> XML document like so:
> 
> <tag1>This</tag1>
>     <tag2>is</tag2>
>        <tag3>a</tag3>
> <tag1>test</tag1>
> 
> I need to write "This is a test" to a text file.  How do I achieve
> this?    Thanks.

PyXML would be a perfect solution - and easy too.

Dave LeBlanc
Seattle, WA USA




More information about the Python-list mailing list