Need to get Tags and Values from Dom
Kushal Kumaran
kushal.kumaran+python at gmail.com
Mon May 14 00:44:19 EDT 2012
On Mon, May 14, 2012 at 6:20 AM, TommyVee <xxxxxxxx at xxxxxx.xxx> wrote:
> I have a very simple XML document that I need to "walk", and I'm using
> xml.dom.minidom. No attributes, just lots of nested tags and associated
> values. All I'm looking to do is iterate through each of the highest
> sibling nodes, check what the tag is, and process its value accordingly. If
> a node has children, same thing - iterate through the nodes, check the tags
> and process the values accordingly. I see where each node object has a
> "childNodes" attribute, so I can drill down the tree. But what are the node
> attributes which indicate Tag and Value? I thought it would have been
> nodeName and nodeValue, but that doesn't seem to be. Does anyone know?
>
A sample of the document you are trying to parse will help people answer.
--
regards,
kushal
More information about the Python-list
mailing list