M
Matt Brown - nyc
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:")
_____________
Any input or direction is appreciated.
Thanks!
Matt
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:")
_____________
Any input or direction is appreciated.
Thanks!
Matt