高手请进!关于读取XML的问题!!!急!!
<?xml version= "1.0 " encoding= "UTF-8 " ?>
- <Package>
- <PackageHead>
<VERSION> 1.00 </VERSION>
<PACKAGENO> 000012007032700001 </PACKAGENO>
<COUNT> 2 </COUNT>
<PACKAGEDATE> 20070327 </PACKAGEDATE>
</PackageHead>
- <Data>
- <Record>
<AcceptNo> 0000000012007032700001 </AcceptNo>
<IDNo> 001 </IDNo>
<Name> 耗子 </Name>
<SexNo> 1 </SexNo>
<Birthday> 19720507 </Birthday>
<NationNo> 01 </NationNo>
<PermanentAddress> 广东省深圳市罗湖区 </PermanentAddress>
<StayAddress> 深圳 </StayAddress>
<SignGov> 深圳市公安局罗湖分局 </SignGov>
<StartDate> 20060829 </StartDate>
<EndDate> 20260829 </EndDate>
<ApplyReason> 01 </ApplyReason>
<CardType> 1 </CardType>
<PhotoNo> IH001251832 </PhotoNo>
</Record>
- <Record>
<AcceptNo> 0000000012007032700002 </AcceptNo>
<IDNo> 002 </IDNo>
<Name> 耗子 </Name>
<SexNo> 1 </SexNo>
<Birthday> 19720507 </Birthday>
<NationNo> 01 </NationNo>
<PermanentAddress> 广东省深圳市罗湖区 </PermanentAddress>
<StayAddress> 深圳 </StayAddress>
<SignGov> 深圳市公安局罗湖分局 </SignGov>
<StartDate> 20060929 </StartDate>
<EndDate> 20260830 </EndDate>
<ApplyReason> 01 </ApplyReason>
<CardType> 1 </CardType>
<PhotoNo> IH001251840 </PhotoNo>
</Record>
</Data>
</Package>
怎样把两个节点 <record> 下所有节点的内容分别读出来呢?
哪位大侠请帮解答一下!谢谢!!!
------解决方案--------------------XmlDocument doc = new ....
doc.LoadXml(yourstrxml )
XmlNodeList nodelist = doc.SelectNode( "/Package/PackageHead/Data/record ");
foreach( XmlNode node in nodelist )
{
...//处理
}