Hi,

If you need to process an XML file, then you don't need a SOAP/XML
library, you need an XML library. You could give a try to lxml, which
is well documented: http://lxml.de/parsing.html


Here's an "off the top of my head" example:


from lxml import etree

rawData = open('file.xml', 'rb').read()
doc = etree.fromstring(rawData)


You can then interact with `doc` as follows:

print doc[0] #assuming that such an element exist
print doc[0].text
doc[0].text = 'new value'



`doc.tostring()` will return a string that corresponds to the changed XML data.




You might want to learn XPath too, which is a convenient way to find
and extract information out of an XML file, and manipulate it in other
ways. Some time ago I made a screencast where lxml is used, along with
XPath queries: https://www.youtube.com/watch?v=PgWfF-Ut0zM

Note that in the screencast I am using lxml's XPath functionality to
find data in a web-page, not from an XML file, but the principle is
the same.


Good luck,
Alex
_______________________________________________
Soap mailing list
[email protected]
https://mail.python.org/mailman/listinfo/soap

Reply via email to