Using xml.xpath question.

0wl bvelkur at yahoo.com
Thu Jul 10 17:47:53 EDT 2003


Hi,

I am trying to get the value of child from  

xmlstr = """<p:root xmlns:p="http://tempuri.org/string"><p:child
DataType="String">Hellpppp</p:child></p:root>"""

using 
doc=parseString(xmlstr)
nodeList = xml.xpath.Evaluate("/p:root/p:child/text()", doc)

and am getting the following exception:

xml.xpath.RuntimeException: Undefined namespace prefix: "p".

I am using python 2.2.2 with PyXML 0.8

I think my usage of the Evaluate is wrong or incomplete. I have tried
to google for information but to no avail. Can anyone please shed
light on this.

Thanks
Bipin




More information about the Python-list mailing list