xml.dom.minidom getElementsByTagName white space issue

Leonardo lozanne leolozanne at yahoo.com
Tue Apr 7 22:22:48 CEST 2009


Hi,
 
I'm getting some XML tags with white spaces from a web service and when I try to get them with the getElements ByTagName I'm not able to do so. I'm getting an empty list. What I'm doing is:
 
#XML_response is an xml string
xml_msg = xml.dom.minidom.parseString(XML_response)
 
nodes = xml_msg.getElementsByTagName("tag ten")  #tag name is "tag ten" with a whitespace
 
It all works fine with tags like tag_seven but NOT for tag names with a white space. I've tried some escape chars but it doesnt seems to work. 
 
Does anybody has the escape char sequence I should be using or a work around for this? Thanks in advanced for your replies. 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090407/e6d88f19/attachment.html>


More information about the Python-list mailing list