积极答复者
如何从xml取数据然后写入到excel

问题
-
xml文件的格式大概是这样的:
-<Log>
-<Local ID="ar-sa">
<caseID id="37677">1</caseID>
<caseID id="37681">0</caseID>
<caseID id="37920">1</caseID>
<caseID id="37934ENmarket">1</caseID>
<caseID id="38864">1</caseID>
<caseID id="40661">1</caseID>
</Local>
-<Local ID="CS-CZ">
<caseID id="37677">1</caseID>
<caseID id="37681">0</caseID>
<caseID id="37920">0</caseID>
<caseID id="37934ENmarket">1</caseID>
<caseID id="38864">0</caseID>
<caseID id="40661">1</caseID>
</Local>
-<Local ID="EL-GR">
<caseID id="37677">1</caseID> <caseID id="37681">0</caseID> <caseID id="37920">0</caseID> <caseID id="37934ENmarket">1</caseID> <caseID id="38864">0</caseID> <caseID id="40661">1</caseID>
</Local>
</Log>
...需要整理成的excel 格式是 第一行从第二个cell开始依次输入local 的ID,
第一列从第二个cell开始依次输入caseid 的ID,然后caseID和local对应的cell里面 输入caseID中的InnerText。
每个local下面的 caseID都是一样的
求指点指点。。
- 已编辑 angel_kei 2013年1月10日 2:18 补充
全部回复
-
您好。
你可以用 这个方法 http://msdn.microsoft.com/zh-cn/library/875kz807.aspx 加载这个XML 文件, 然后遍历每一个节点.
具体方法可以参看这个例子: http://www.codeproject.com/Articles/4902/Reading-an-XML-file-using-NET
谢谢。
Mike Feng
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help. -
具体解决方案呢??
Mike Feng
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.