Ejemplo n.º 1
0
        public static XPathDocument StripNamespaces(IXPathNavigable navigableSet, bool removeDocType)
        {
            XPathDocument newXml = null;

            if (navigableSet == null)
            {
                return(newXml);
            }

            XPathNavigator node = navigableSet.CreateNavigator();

            string xmlString = XmlUtility.StripNamespaces(node.OuterXml, removeDocType);

            using (StringReader s = new StringReader(xmlString))
            {
                newXml = new XPathDocument(s);
            }
            return(newXml);
        }
Ejemplo n.º 2
0
 public static XPathDocument StripNamespaces(IXPathNavigable navigableSet)
 {
     return(XmlUtility.StripNamespaces(navigableSet, false));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Strip the namespaces from specified <see cref="System.String"/>.
 /// </summary>
 /// <param name="xml">
 /// The source <see cref="System.String"/>.
 /// </param>
 /// <remarks>
 /// WARNING: Stripping namespaces “flattens” the document
 /// and can cause local-name collisions.
 ///
 /// This routine does not remove namespace prefixes.
 ///
 /// </remarks>
 public static string StripNamespaces(string xml)
 {
     return(XmlUtility.StripNamespaces(xml, false));
 }