Hi,
  Recently ,I just turn to Python from C#.However ,as a dynamic  language .
Python and C# was so different.
 
 Now ,I want to get some record from an XML file,The format of the XML file as follow:
...............................
<Doc rID="T1"  >
    <DName><![CDATA[Release Truck]]></DName>
    <Res><![CDATA[Res18]]></Res>
 
   <DT rID="T2">
      <NodeArgs eType="Table" icon="2" nRep="5" filter="False" >
        <Disp><![CDATA[Run-Time Data]]></Disp>
        <BtmPane vType="Table">
          <Path><![CDATA[Default.xls]]></Path>
        </BtmPane>
      </NodeArgs>
    </DT>
 
    <NodeArgs eType="StartTest" icon="1" nRep="4" status="Failed" >
      <Disp><![CDATA[Test Release Truck Summary]]></Disp>
    </NodeArgs>
 
</Doc>
....................................
 
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?
and how should i do when i want to get the value of the in the CDATA section?
 
 
 
 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to