Class XmlNode
- Namespace
- NUnit.Framework.Interfaces
- Assembly
- nunit.framework.dll
XmlNode represents a single node in the XML representation of a Test or TestResult. It replaces System.Xml.XmlNode and provides a minimal set of methods for operating on the XML in a platform-independent manner.
public class XmlNode
- Inheritance
-
XmlNode
- Inherited Members
Constructors
XmlNode(string)
Constructs a new instance of XmlNode
public XmlNode(string name)
Parameters
name
stringThe name of the node
Properties
Attributes
Gets the dictionary of attributes
public AttributeDictionary Attributes { get; }
Property Value
ChildNodes
Gets a list of child nodes
public NodeList ChildNodes { get; }
Property Value
EscapedTextContent
Gets the text content of the node escaped as needed. This is for use in writing out the XML representation.
public string EscapedTextContent { get; }
Property Value
FirstChild
Gets the first child of this node, or null
public XmlNode FirstChild { get; }
Property Value
Name
Gets the name of the node
public string Name { get; }
Property Value
OuterXml
Gets the outer XML.
public string OuterXml { get; }
Property Value
- string
The outer XML.
TextContent
Gets the text content of the node
public string TextContent { get; set; }
Property Value
Methods
AddAttribute(string, string)
Adds an attribute with a specified name and value to the XmlNode.
public void AddAttribute(string name, string value)
Parameters
AddElement(string)
Adds a new element as a child of the current node and returns it.
public XmlNode AddElement(string name)
Parameters
name
stringThe element name.
Returns
- XmlNode
The newly created child element
CreateTopLevelElement(string)
Creates a new top level element node.
public static XmlNode CreateTopLevelElement(string name)
Parameters
name
stringThe element name.
Returns
FindDescendant(string)
Finds a single descendant of this node matching an xpath specification. The format of the specification is limited to what is needed by NUnit and its tests.
public XmlNode FindDescendant(string xpath)
Parameters
xpath
string
Returns
FindDescendants(string)
Finds all descendants of this node matching an xpath specification. The format of the specification is limited to what is needed by NUnit and its tests.
public NodeList FindDescendants(string xpath)
Parameters
xpath
string
Returns
WriteTo(XmlWriter)
Writes the XML representation of the node to an XmlWriter
public void WriteTo(XmlWriter writer)
Parameters
writer
XmlWriter