Parsing a MS Word generated XML file in C#

前端 未结 1 1413
野性不改
野性不改 2021-01-25 08:01

So I have a client (this could only come from the government) who has a bunch of MS Word docs they want entered into a database, and short of manual entry, I feel like convertin

1条回答
  •  暖寄归人
    2021-01-25 08:55

    I looks like you have the wrong node name in your XPath expression. Replace all occurrences of w:document with w:wordDocument. So it should be:

    XmlNodeList node = xmlDoc.SelectNodes("//w:wordDocument/descendant::w:t|//w:wordDocument/descendant::w:p|//w:wordDocument/descendant::w:tab", nsmgr);
    

    0 讨论(0)
提交回复
热议问题