Updated D Benchmarks
bearophile
bearophileHUGS at lycos.com
Sun Mar 15 14:10:53 PDT 2009
Sorry, assuming a "tidy XML file" is silly. Better:
from xml.dom.minidom import parse
r = parse("results.xml").getElementsByTagName("results")
results = r[0].getElementsByTagName("result")
# print field names
fields = [n.localName for n in results[0].childNodes if n.nodeType != n.TEXT_NODE]
print " ".join(fields)
# print data
for r in results:
print " ".join(r.getElementsByTagName(f)[0].firstChild.data for f in fields)
Bye,
bearophile
More information about the Digitalmars-d
mailing list