实现功能:
用XML结点的属性值查找相同结点的其它属性值,即如下的xml,输入一个001,能得出FistTag_Value这个值来.
1)首先,把下面的xml文档存在D盘目录下,命名为:Test.xml,xml文档内容如下
//-------------------------------------xml文档分割线----------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<HeadData>
<Item>
<SystemType>0</SystemType>
<tag Entrytag="001" NodeName="FistTag_Value">
<FistNode>0001</FistNode>
<SecondNode>0001</SecondNode>
</tag>
</Item>
<Item>
<SystemType>0</SystemType>
<tag Entrytag="002" NodeName="SecondTag_Value">
<FistNode>0002</FistNode>
<SecondNode>0002</SecondNode>
</tag>
</Item>
<Item>
<SystemType>0</SystemType>
<tag Entrytag="003" NodeName="ThirdTag_Value">
<FistNode>0003</FistNode>
<SecondNode>0003</SecondNode>
</tag>
</Item>
</HeadData>
//-------------------------------------xml文档分割线----------------------------------------------
2)代码实现,注释都写得很清楚了,我就不细说了