XmlData Remove Method Delta Engine Documentation

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

public void Remove()
Remarks

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

3 unit tests call DeltaEngine.Content.Xml.XmlData.Remove
[Test]
public void Remove()
{
    XmlData root = CreateDeepTestXmlData();
    root.Children[0].Remove();
    Assert.AreEqual(3, root.GetTotalNodeCount());
    root.Children[0].Remove();
    Assert.AreEqual(1, root.GetTotalNodeCount());
}
[Test]
public void RemoveChild()
{
    XmlData root = CreateDeepTestXmlData();
    Assert.IsTrue(root.RemoveChild(root.Children[0]));
    Assert.IsFalse(root.RemoveChild(new XmlData("unknown")));
}
[Test]
public void RemoveAttribute()
{
    var root = new XmlData("root");
    root.AddAttribute("attribute1", "value1");
    root.AddAttribute("attribute2", "value2");
    root.AddAttribute("attribute1", "value3");
    root.RemoveAttribute("attribute1");
    Assert.AreEqual(1, root.Attributes.Count);
    root.RemoveAttribute("attribute3");
    Assert.AreEqual(1, root.Attributes.Count);
}
See Also