Jake b, 16.05.2010 09:40:
Check out Amara: http://www.xml3k.org/Amara/QuickRef

It looks promising. For a pythonic solution over sax / dom.

>>> Iter(doc.team.player)
# or
>>> doc.team.player[0].name

Ah, right, and there's also lxml.objectify:

    from lxml.objectify import parse

    root = parse('teamfile.xml').getroot()

    for player in root.player:
        print(player.attrib)

Prints an attribute dict for each player.

Stefan

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to