如何使用LINQ to XML获取xml数据 [英] How to fetch xml data using LINQ to XML
本文介绍了如何使用LINQ to XML获取xml数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Xml数据:
Xml data:
<Products>
<DriveType Value ="System Drives">
<ProductType value="100001">
<Firmware id="001" AppVersion="01"/>
<Firmware id="002" AppVersion="02"/>
</ProductType>
<ProductType value="100002">
<Firmware id="001" AppVersion="03"/>
<Firmware id="002" AppVersion="04"/>
</ProductType>;
</DriveType>
<DriveType Value ="Other Drives">
<ProductType value="100008">
<Firmware id="001" AppVersion="05"/>
<Firmware id="002" AppVersion="06"/>
</ProductType>
<ProductType value="1000012">
<Firmware id="001" AppVersion="07"/>
<Firmware id="002" AppVersion="08"/>
</ProductType>;
</DriveType>
</<Products>>
推荐答案
网上提供了很好的教程和示例。希望这些可以帮助您提取确切的数据(您还没有提到您正在寻找的是什么):
http://www.dotnetcurry.com/linq/564/linq-to-xml-tutorials-examples [ ^ ]
https://msdn.microsoft.com/en-us/library/bb943906.aspx [ ^ ]
请首先尝试使用这些示例,然后在发生任何特定问题时告知。
谢谢。
There are good tutorials and examples available online. Hope these will help you to extract exact data (you have not mentioned what exactly you are looking for):
http://www.dotnetcurry.com/linq/564/linq-to-xml-tutorials-examples[^]
https://msdn.microsoft.com/en-us/library/bb943906.aspx[^]
Please first try with those examples and then let is know in case of any specific issue.
Thanks.
这篇关于如何使用LINQ to XML获取xml数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文