minidom, drilling down to a low node in one line?
Matt Brown - nyc
MatthewBrown at gmail.com
Fri Jan 16 13:33:03 EST 2009
More information about the Python-list mailing list
Fri Jan 16 13:33:03 EST 2009
- Previous message (by thread): Python 3: range objects cannot be sliced
- Next message (by thread): FileCookieJar has not attribute "_self_load"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello, I hope this isn't completely redundant... I'm working with an example found of parsing XML with xml.dom.minidom and am having some issues getting a node down three levels. Here is the tutorial: http://diveintopython.org/xml_processing/parsing_xml.html Given the XML: _____________ <?xml version="1.0" ?> <grammar> <ref id="bit"> <p>0</p> <p>1</p> </ref> </grammar> _____________ How do I address the textNode.data that = 0? The only way I figured out is to recursively childNode from the parsed down (as following the guide). Is there no way to simply address the item by something along the lines of: _____________ xmldoc = minidom.parse("example.xml") xmldoc.getElementsByTagName("grammar:ref:p:") _____________ Any input or direction is appreciated. Thanks! Matt
- Previous message (by thread): Python 3: range objects cannot be sliced
- Next message (by thread): FileCookieJar has not attribute "_self_load"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list