Using xmllib

Pieter Claerhout PClaerhout at CREO.BE
Wed Apr 12 07:38:41 EDT 2000


Hello,

does anyone has an example on how to use the xmllib to parse an xmlfile?
I have an xml-file, which looks a bit like this:

<!-- a general comment -->
<COLLECTION VERSION="1">
    <GENERAL PATH="S:\" />
    <ITEM NAME="Item1">
        <DESCRIPTION>Item 1 description.</DESCRIPTION>
        <DATE>Thu Dec 16 16:35:05 1999</DATE>
    </ITEM>
    <ITEM NAME="Item2">
        <DESCRIPTION>Item 2 description.</DESCRIPTION>
        <DATE>Wed Mar 15 11:54:27 2000</DATE>
    </ITEM>
</COLLECTION>

I want to convert it to something like this:

Collection from path s:\

- Item 1 (Thu Dec 16 16:35:05 1999)
  Item 1 description.
- Item 2 (Wed Mar 15 11:54:27 2000)
  Item 2 description.

Anyone an idea on how to do that with XMLlib?

Kind regards,


Pieter
Pieter_Claerhout at creoscitex.com




More information about the Python-list mailing list