1

例如

           XmlNamespaceManager nsmgr = new XmlNamespaceManager(myxmldocument.NameTable);
           nsmgr.AddNamespace("xdp", "http://ns.adobe.com/xdp/");
           nsmgr.AddNamespace("config", "http://www.xfa.org/schema/xci/1.0/");

同样,我们如何在 XDocument 中添加?

4

1 回答 1

0
string s = myXDocument.ToString();//my XDocument  corresponds to our existing XDocument
XPathDocument xpath = new XPathDocument(new StringReader(s));
        XPathNavigator pathnavigator= xpath .CreateNavigator();
        XmlNamespaceManager nsmgr = new XmlNamespaceManager(pathnavigator.NameTable);
于 2012-10-27T04:31:29.167 回答