Beispiel #1
0
        public static XmlDocument RemoveNamespace(XmlNode node, bool onlyRemoveEmptyPrfix)
        {
            if (node == null)
            {
                return(null);
            }
            XmlSkipingReader reader = new XmlSkipingReader(new StringReader(node.OuterXml))
            {
                OnlySkipEmptyPrfix   = onlyRemoveEmptyPrfix,
                RemoveXmlDeclaration = true
            };
            XmlDocument document = new XmlDocument();

            document.Load(reader);
            return(document);
        }
Beispiel #2
0
 public static XmlDocument RemoveNamespace(XmlNode node, bool onlyRemoveEmptyPrfix)
 {
     if (node == null)
     {
         return null;
     }
     XmlSkipingReader reader = new XmlSkipingReader(new StringReader(node.OuterXml))
     {
         OnlySkipEmptyPrfix = onlyRemoveEmptyPrfix,
         RemoveXmlDeclaration = true
     };
     XmlDocument document = new XmlDocument();
     document.Load(reader);
     return document;
 }