Table of Contents

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

XmlNamespaceManager

Methods

ParseAndRemoveNamespacesXDocument(string)

Parses an XML string, removes namespace declarations, and returns the result as an XDocument.

public XDocument ParseAndRemoveNamespacesXDocument(string content)

Parameters

content string

The XML content to parse.

Returns

XDocument

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

content string

The XML content to parse.

nameTable XmlNameTable

The XmlNameTable to use.

defaultPrefix string

The prefix to assign to the default namespace.

Returns

XDocument

ParseAndRemoveNamespacesXmlDocument(string)

Parses an XML string, extracts namespace declarations into NamespaceManager, and removes them from the document.

public XmlDocument ParseAndRemoveNamespacesXmlDocument(string content)

Parameters

content string

The XML content to parse.

Returns

XmlDocument

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

content string

The XML content to parse.

nameTable XmlNameTable

The XmlNameTable to use for the namespace manager.

defaultPrefix string

The prefix to assign to the default namespace.

Returns

XmlDocument