使用LINQ从XML中提取列表[OpenXML] [英] Using LINQ to extract list from XML [OpenXML]

查看:99
本文介绍了使用LINQ从XML中提取列表[OpenXML]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是通过OpenXML从Word文档生成的XML文件:


XML链接在这里


我想使用LINQ获取以下列表:





解决方案

您好,



不幸的是,我认为LINQ不会发生在这里工作,因为Word XML在文档中有专有信息。例如":"在元素名称中。 LINQ for XML无法理解查询中的冒号。


您应该使用office命名空间来解析此文件:


https://archworx.wordpress.com/2007/05/10/parsing-word-document -in-C /


The following is the XML file that is generated from Word document through OpenXML:

XML Link here

I want to get the following list using LINQ:


解决方案

Hello,

Unfortunately, I don't think LINQ is going to work for you here as Word XML has proprietary information in the document. For instance ":" in the element names. LINQ for XML is unable to understand the colon in the queries.

You should use the office namespaces to parse this file:

https://archworx.wordpress.com/2007/05/10/parsing-word-document-in-c/


这篇关于使用LINQ从XML中提取列表[OpenXML]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆