读取InfoPath的命名空间

 

说明:11_00020.xml为InfoPath的xml文件。利用Linq to xml来便捷地读取相关节点。

XmlDocument doc = new XmlDocument();
                doc.Load("D:\\11_00020.xml");
                XElement xmlTree = XElement.Parse(doc.OuterXml);
                XNamespace awNamespace = xmlTree.GetNamespaceOfPrefix("my");
                Console.WriteLine("Namespace: {0}", awNamespace);

                Console.ReadLine();

原文地址:https://www.cnblogs.com/mingle/p/2308217.html