XmlData ClassDelta Engine Documentation
Simplified Xml handling View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Content.Xml XmlData

Namespace: DeltaEngine.Content.Xml
Assembly: DeltaEngine.Content.Xml (in DeltaEngine.Content.Xml.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class XmlData

The XmlData type exposes the following members.

Constructors

  NameDescription
Protected methodXmlData 
Initializes a new instance of the XmlData class
Public methodXmlData(String)
Initializes a new instance of the XmlData class
Top
Methods

  NameDescription
Public methodAddAttribute
Public methodAddChild(XmlData)
Public methodAddChild(String, Object)
Public methodClearAttributes
Public methodCreateRootXElement
Public methodGetAttributesAsDictionary
Public methodGetAttributeValue(String)
Public methodGetAttributeValue T (String, T)
Public methodGetChild
Public methodGetChildren
Public methodGetChildValue T 
Public methodGetDescendant(String)
Public methodGetDescendant(XmlAttribute, String)
Public methodGetDescendant(List XmlAttribute , String)
Public methodGetDescendantValue
Public methodGetTotalNodeCount
Public methodRemove
Public methodRemoveAttribute
Public methodRemoveChild
Public methodToString  (Overrides Object ToString .)
Public methodToString(Boolean)
Public methodUpdateAttribute
Top
Extension Methods

  NameDescription
Public Extension MethodAddMetaDataEntry (Defined by XmlMetaDataExtensions.)
Top
Properties

  NameDescription
Public propertyAttributes
Public propertyChildren
Public propertyName
Public propertyParent
Public propertyValue
Top
Remarks

Tests: DeltaEngine.Content.Xml.Tests.XmlDataTests
Examples

31 unit tests call DeltaEngine.Content.Xml.XmlData
[Test]
public void Constructor()
{
    var root = new XmlData("name");
    Assert.AreEqual("name", root.Name);
    Assert.AreEqual(0, root.Children.Count);
    Assert.AreEqual(0, root.Attributes.Count);
}
[Test]
public void InvalidName()
{
    Assert.Throws<XmlData.InvalidXmlNameException>(() => new XmlData(null));
    Assert.Throws<XmlData.InvalidXmlNameException>(() => new XmlData("Hello World"));
}
[Test]
public void GetChild()
{
    var root = new XmlData("root");
    root.AddChild(new XmlData("child1"));
    var child2 = new XmlData("child2");
    root.AddChild(child2);
    Assert.AreEqual(child2, root.GetChild("child2"));
}
See Also