使用LINQ从XML中提取列表[OpenXML] [英] Using LINQ to extract list from XML [OpenXML]
问题描述
以下是通过OpenXML从Word文档生成的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:
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屋!