lmlx & & caracter

Toff christophedeze at gmail.com
Tue Oct 27 03:29:06 EDT 2009


hello

i can't parse a file with lxml


================================================================
  <?xml version="1.0" encoding="iso-8859-1" ?>
 <packages>
 <package id="firefox" name="FireFox 3.5" >
  <download url="http://download.mozilla.org/?
product=firefox-3.5&os=win&lang=fr"  />
  </package>
  </packages>
=========================================================================

i know that & is a special caracter in xml

but how to parse the file

here is what i do :
                filename = "file.xml"
                xml = etree.parse(filename)
                xml = ET.parse(filename)
                for group in xml.getiterator('package'):
                    print group.get('id')





More information about the Python-list mailing list