[XML-SIG] Re: XML Objectify.. how to iterate through child tags?

Petri Savolainen petri.savolainen at iki.fi
Wed Nov 12 19:47:03 EST 2003

If I remember correctly, gnosis xml pkg sort of wraps the iterator api 
around xml container elements. So you can simply say "for element in 
test". No need for special ".childnode" accessor; just think of test as 
a list [a,b,c].



Terence Lo wrote:

> Say I have an xml file (test.xml) that contains:
> <test>
> 	<a>aaa</a>
> 	<b>bbb</b>
> 	<c>ccc</c>
> </test>
> source = XML_Objectify('test.xml').make_instance()
> How do I dynamically iterate through the children tags and values of <test>?
> I'd like to do something similar to what DOM does, (ie. childnode[0],
> childnode[1].. etc)
> Is this possible?  Anyone know? Any help would be greatly appreciated.
> Thanks in advance.
> t
> _______________________________________________
> XML-SIG maillist  -  XML-SIG at python.org
> http://mail.python.org/mailman/listinfo/xml-sig

More information about the XML-SIG mailing list