我需要从打开的 xml 文档中获取特定表的 xmlinnerText == "something" & "somethingelse"
例子 :
using (WordprocessingDocument doc = WordprocessingDocument.Open(path, false))
{
MainDocumentPart mainPart = doc.MainDocumentPart;
string xml = mainPart.Document.Descendants<Table>().Select // where innerText == "this" || innerText == "that"
Console.WriteLine(xml);
MainDocumentPart documentPrincipal = document.MainDocumentPart;
documentPrincipal.Document.InnerXml = documentPrincipal.Document.InnerXml.Replace(replacethisby, that);
documentPrincipal.Document.Save();
document.Dispose();
}
我该如何做到这一点?非常感谢。