Kevien Lee wrote: > when i use the minidom to parase the XML file,it would ignored the section > of <![CDATA[.......]> > the code is: > > _document=minidom.parse("filePath") > _documnetList=_document.getElementsByTagName("NodeArgs") > for _argNode in _documnetList: > print _argNode.nodeValue,_argNode.localName > > when it run. The nodeValue of the CDATA Section is always None,Is my code > error?
here's one way to do it, under Python 2.5: import xml.etree.ElementTree as ET tree = ET.parse(filename) for elem in tree.findall(".//NodeArgs"): print elem.findtext("Disp") print elem.findtext("BtmPane/Path") </F> -- http://mail.python.org/mailman/listinfo/python-list