我目前正在写一个读取XML文件的程序,但是现在的XML文件内部结构很复杂,而且我又只想取出某个节点里的值,现在不知如何下手,请教高手该如何写?下面是我XML文件的内容,我想取的节点内容是ma-name、run-profile-name、start-date、end-date、partition、stage-no-change。
<run-history>
<run-details>
<ma-id>{41C5F4EA-044D-46CA-9D08-D5C8298ECE04} </ma-id>
<ma-name>S1 Lotus Notes To MA </ma-name>
<run-number>25 </run-number>
<run-profile-name>Import </run-profile-name>
<security-id>TEST\admin </security-id>
<step-details step-number="3" step-id="{656FCCf2-6250-47BA-A9D7-15F5C999D3F8}">
<start-date>2010-01-19 05:09:13.793 </start-date>
<end-date>2010-01-19 05:10:19.007 </end-date>
<step-result>success </step-result>
<step-description>
<step-type type="full-import">
<import-subtype>to-cs </import-subtype>
</step-type>
<partition>pdl.nsf </partition>
</step-description>
<current-export-step-counter>0 </current-export-step-counter>
<last-successful-export-step-counter>0 </last-successful-export-step-counter>