从XML文件中读取节点列表. [英] Read the llist of nodes form XML file.
本文介绍了从XML文件中读取节点列表.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,请帮忙,
我有一个xml文件.看起来像
Hi any please help,
I have a xml file. this look like
<Worksheet ss:Name="Combined Account Statement">
−
<Table ss:ExpandedColumnCount="15" ss:ExpandedRowCount="96" x:FullColumns="1" x:FullRows="1"></Table></Workbook>
我想从xml文件中读取节点列表.我找不到节点列表.由于每个xml标记都应用了样式.
I want to read the list of nodes from the xml file. I cant find the nodelist. Because of each xml tag have applied styles.
if (xmlDoc.DocumentElement.SelectNodes("Workbook/Worksheet[ss:Name='Combined Account Statement']").Count > 0)
MainNodeList = xmlDoc.DocumentElement.SelectNodes("Workbook/Worksheet[ss:Name='Combined Account Statement']");
如何从xml文件读取节点列表.
How can i read the list of nodes form xml files.
推荐答案
使用最简单的方法-递归遍历文档树中的所有节点.将想要的节点添加到集合中.
问候
Espen Harlinn
Use the simplest method - recursively iterate over all the nodes in the document tree. Add the nodes you want to a collection.
Regards
Espen Harlinn
递归地迭代线程中的所有节点.将想要的节点添加到集合中.
希望对您有帮助.
recursively iterate over all the nodes in the thread. Add the nodes you want to a collection.
Hope this will help you.
这篇关于从XML文件中读取节点列表.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文