Class XmlNamespacesHolder
- Namespace
- SunamoXml
- Assembly
- SunamoXml.dll
Parses XML documents while extracting and removing namespace declarations, storing them in an XmlNamespaceManager for later use.
public class XmlNamespacesHolder
- Inheritance
-
XmlNamespacesHolder
- Inherited Members
- Extension Methods
Properties
NamespaceManager
The namespace manager populated during parsing with all extracted namespace declarations.
public XmlNamespaceManager? NamespaceManager { get; set; }
Property Value
Methods
ParseAndRemoveNamespacesXDocument(string)
Parses an XML string, removes namespace declarations, and returns the result as an XDocument.
public XDocument ParseAndRemoveNamespacesXDocument(string content)
Parameters
contentstringThe XML content to parse.
Returns
ParseAndRemoveNamespacesXDocument(string, XmlNameTable, string)
Parses an XML string using the specified name table, removes namespace declarations, and returns the result as an XDocument.
public XDocument ParseAndRemoveNamespacesXDocument(string content, XmlNameTable nameTable, string defaultPrefix = "x")
Parameters
contentstringThe XML content to parse.
nameTableXmlNameTableThe XmlNameTable to use.
defaultPrefixstringThe prefix to assign to the default namespace.
Returns
ParseAndRemoveNamespacesXmlDocument(string)
Parses an XML string, extracts namespace declarations into NamespaceManager, and removes them from the document.
public XmlDocument ParseAndRemoveNamespacesXmlDocument(string content)
Parameters
contentstringThe XML content to parse.
Returns
ParseAndRemoveNamespacesXmlDocument(string, XmlNameTable, string)
Parses an XML string using the specified name table, extracts namespace declarations, and removes them from the document. The default prefix is used for the default namespace since XPath queries require a prefix (/:Tag doesn't work, but /prefix:Tag does).
public XmlDocument ParseAndRemoveNamespacesXmlDocument(string content, XmlNameTable nameTable, string defaultPrefix = "x")
Parameters
contentstringThe XML content to parse.
nameTableXmlNameTableThe XmlNameTable to use for the namespace manager.
defaultPrefixstringThe prefix to assign to the default namespace.