Class XmlExtensions
The XmlExtensions class allows you to write more efficient code to manage Xml documents.
Inheritance
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public static class XmlExtensions : object
Methods
| Improve this Doc View SourceAddAttribute(XmlNode, String, String, String, String)
Adds an attribute to an XmlNode using the specified namespace.
Declaration
public static XmlNode AddAttribute(this XmlNode node, string attributeName, string attributeValue, string namespaceUri, string namespaceAbbr)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | node | The node to add the attribtue to. |
| System.String | attributeName | Name of the attribute without the namespace abbreviation prefix. |
| System.String | attributeValue | The attribute value. |
| System.String | namespaceUri | The namespace URI. |
| System.String | namespaceAbbr | The namespace abbreviation. |
Returns
| Type | Description |
|---|---|
| XmlNode | The node the attribute was added to. |
AddAttribute(XmlNode, String, String)
Adds an attribute to the specified node.
Declaration
public static XmlNode AddAttribute(this XmlNode node, string attributeName, string attributeValue)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | node | The node to add the attribute to. |
| System.String | attributeName | Name of the attribute. |
| System.String | attributeValue | The attribute value. |
Returns
| Type | Description |
|---|---|
| XmlNode | The node the attribute was added to. |
AddElement(XmlNode, String, String, Boolean, String, String)
Adds an element to the specified XmlNode using the specified namespace.
Declaration
public static XmlNode AddElement(this XmlNode node, string elementName, string elementValue, bool useCData, string namespaceUri, string namespaceAbbr)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | node | The node to add the element to. |
| System.String | elementName | Name of the element (without the abbreviated prefix). |
| System.String | elementValue | The element value. |
| System.Boolean | useCData | if set to |
| System.String | namespaceUri | The namespace URI. |
| System.String | namespaceAbbr | The namespace abbreviation. |
Returns
| Type | Description |
|---|---|
| XmlNode | The added node. |
AddElement(XmlNode, String, String, Boolean)
Adds an element to the specified XmlNode.
Declaration
public static XmlNode AddElement(this XmlNode node, string elementName, string elementValue, bool useCData)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | node | The node to add the element to. |
| System.String | elementName | Name of the element. |
| System.String | elementValue | The element value. |
| System.Boolean | useCData | if set to |
Returns
| Type | Description |
|---|---|
| XmlNode | The added element. |
AddElement(XmlNode, String, String)
Adds an element to the specified XmlNode.
Declaration
public static XmlNode AddElement(this XmlNode node, string elementName, string elementValue)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | node | The node to add the element to. |
| System.String | elementName | Name of the element. |
| System.String | elementValue | The element value. |
Returns
| Type | Description |
|---|---|
| XmlNode | The added element. |
RemoveChildNode(XmlNode, String)
Remove the child node with the provided name.
Declaration
public static void RemoveChildNode(this XmlNode node, string childNodeName)
Parameters
| Type | Name | Description |
|---|---|---|
| XmlNode | node | The parent node. |
| System.String | childNodeName | The child node name. |