[Chicago] modifying xml ?

Lukasz Szybalski szybalski at gmail.com
Thu Oct 14 22:16:05 CEST 2010


I was looking for more of an lxml examples.

Here is how I extract information but how can I update it?

from lxml import etree
doc = etree.parse (XMLRequest.xml')
root=doc.getroot()

print root.find("InsuranceSvcRq/PersAutoPolicyQuoteInqRq/PersPolicy/PolicyNumber").text

This will give me a text in that node, but how can I update that?
etree.XPath("InsuranceSvcRq/PersAutoPolicyQuoteInqRq/PersPolicy/PolicyNumber")
=' 123123' doesn't really work?!


I'm not an xml expert, but either its hard to find documentation on
how to do that or I'm looking for the wrong thing?!

Thanks,
Lucas


More information about the Chicago mailing list