IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
NUnit.Common.XmlHelper Class Reference

XmlHelper provides static methods for basic XML operations. More...

Static Public Member Functions

static XmlNode CreateTopLevelElement (string name)
 Creates a new top level element node. More...
 
static XmlNode CreateXmlNode (string xml)
 
static void AddAttribute (this XmlNode node, string name, string value)
 Adds an attribute with a specified name and value to an existing XmlNode. More...
 
static XmlNode AddElement (this XmlNode node, string name)
 Adds a new element as a child of an existing XmlNode and returns it. More...
 
static XmlNode AddElementWithCDataSection (this XmlNode node, string name, string data)
 Adds the a new element as a child of an existing node and returns it. A CDataSection is added to the new element using the data provided. More...
 
static string GetAttribute (this XmlNode result, string name)
 Gets the value of the given attribute. More...
 
static int GetAttribute (this XmlNode result, string name, int defaultValue)
 Gets the value of the given attribute as an int. More...
 
static double GetAttribute (this XmlNode result, string name, double defaultValue)
 Gets the value of the given attribute as a double. More...
 
static DateTime GetAttribute (this XmlNode result, string name, DateTime defaultValue)
 Gets the value of the given attribute as a DateTime. More...
 

Detailed Description

XmlHelper provides static methods for basic XML operations.

Member Function Documentation

static XmlNode NUnit.Common.XmlHelper.CreateXmlNode ( string  xml)
inlinestatic
static void NUnit.Common.XmlHelper.AddAttribute ( this XmlNode  node,
string  name,
string  value 
)
inlinestatic

Adds an attribute with a specified name and value to an existing XmlNode.

Parameters
nodeThe node to which the attribute should be added.
nameThe name of the attribute.
valueThe value of the attribute.

Referenced by NUnit.Engine.Runners.ProcessRunner.CreateFailedResult(), and NUnit.Common.Tests.XmlHelperTests.SingleElementWithAttributes().

static XmlNode NUnit.Common.XmlHelper.AddElement ( this XmlNode  node,
string  name 
)
inlinestatic

Adds a new element as a child of an existing XmlNode and returns it.

Parameters
nodeThe node to which the element should be added.
nameThe element name.
Returns
The newly created child element
static XmlNode NUnit.Common.XmlHelper.AddElementWithCDataSection ( this XmlNode  node,
string  name,
string  data 
)
inlinestatic

Adds the a new element as a child of an existing node and returns it. A CDataSection is added to the new element using the data provided.

Parameters
nodeThe node to which the element should be added.
nameThe element name.
dataThe data for the CDataSection.
Returns
static string NUnit.Common.XmlHelper.GetAttribute ( this XmlNode  result,
string  name 
)
inlinestatic

Gets the value of the given attribute.

Parameters
resultThe result.
nameThe name.
Returns

Referenced by NUnit.Common.Tests.XmlHelperTests.SafeAttributeAccess(), and NUnit.Common.Tests.XmlHelperTests.SafeAttributeAccessWithIntDefaultValue().

static int NUnit.Common.XmlHelper.GetAttribute ( this XmlNode  result,
string  name,
int  defaultValue 
)
inlinestatic

Gets the value of the given attribute as an int.

Parameters
resultThe result.
nameThe name.
defaultValueThe default value.
Returns
static double NUnit.Common.XmlHelper.GetAttribute ( this XmlNode  result,
string  name,
double  defaultValue 
)
inlinestatic

Gets the value of the given attribute as a double.

Parameters
resultThe result.
nameThe name.
defaultValueThe default value.
Returns
static DateTime NUnit.Common.XmlHelper.GetAttribute ( this XmlNode  result,
string  name,
DateTime  defaultValue 
)
inlinestatic

Gets the value of the given attribute as a DateTime.

Parameters
resultThe result.
nameThe name.
defaultValueThe default value.
Returns

The documentation for this class was generated from the following file: