On Apr 17, 1:05 pm, Christian Heimes <christ...@python.org> wrote:
> Am 17.04.2013 19:55, schrieb darnold:
>
> > On Apr 17, 8:50 am, Ombongi Moraa Fe <moraa.lovetak...@gmail.com>
> > wrote:
>
> >> how do I use xml.etree.ElementTree to print the parameters address and
> >> deliveryStatus? Or is there a better python method?
>
> > I'm sure there are prettier ways to do this, but you can use XPath
> > syntax to find all of your ns1:result nodes and loop through them:
>
> You want all {http://www.csapi.org/schema/parlayx/sms/send/v2_2/
> local}result tags. The prefix isn't fixed.

I'm sorry, but I'm not understanding the difference.
By specifying:

>>> myNamespaces=dict(ns1="http://www.csapi.org/schema/parlayx/sms/send/v2_2/local";)

Isn't this:

>>> for result in root.findall('.//ns1:result',namespaces=myNamespaces):

equivalent to:

>>> for result in 
>>> root.findall('.//{http://www.csapi.org/schema/parlayx/sms/send/v2_2/local}result'):

?

Or am I misunderstanding? Is there a namespace-agnostic way of doing
this?
Admittedly, I haven't used ElementTree or XPath much prior to toying
with them to (attempt to) answer the OP's question.

Thanks for your patience,
Don
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to