On Mon, Jul 2, 2012 at 12:31 PM, Sean Carolan <scaro...@gmail.com> wrote:

> How do you say, "If the field is 11, then print the next value"?  The
> raw XML looks like this:
>
> <datum>
> <index>1</index>
> <field>11</field>
> <value>9780470286975</value>
> </datum>
>

Instead of iterating over the whole tree, grab all the <datum> elements
then retrieve the <field> child, check the field value, and if '11', then
pull the <value> value.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to