[Tutor] Amara pushbind to retrieve data from Xml Doc

kieran flanagan kieran.flanagan at gmail.com
Thu May 18 18:15:24 CEST 2006


Hey

I am pretty new to Python ( about a day old ). I am currently writing a
small script to just cycle through an XML page and retrieve data if it
exists. So for example an extract from the Xml page will have an element
tagged entry like so

<element name="Something" type="Something" originalValue="">I want this
data</element>

I can use the following loop to list out all element.name, element.type and
element.originalValue like so

        for subtree in binderytools.pushbind('/screen/panel/list/row/element',
source=xmlfile):
            print subtree.originalValue

source=xmlfile is just referencing a variable I have set to point to the
actual xml page. How can I change the above loop to cycle through each
<element ........ >, check if data exists like above and print this out.

Any help would be appreciated.
Thanks
k


-- 
"Behind every great man, there is a great woman. Behind that woman is Mr.T."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060518/aeb9783b/attachment.htm 


More information about the Tutor mailing list