InsertElementBefore() public method

새로운 XmlElement를 refNode 앞에 추가한다.
public InsertElementBefore ( XmlElement refNode, XmlElement newNode ) : XmlElement
refNode System.Xml.XmlElement
newNode System.Xml.XmlElement
return System.Xml.XmlElement
Exemplo n.º 1
0
        public void InsertElementTest() {
            var doc = new XmlDoc("<root/>");
            var node = doc.InsertBefore(doc.CreateXmlDeclaration("1.0", "utf-8", ""), doc.DocumentElement);
            Assert.IsNotNull(node);

            var firstElement = doc.AddElementText(doc.DocumentElement, "first", "");
            Assert.IsNotNull(firstElement);

            var second = doc.InsertElementBefore(firstElement, "second", "");
            Assert.IsNotNull(second);
        }
Exemplo n.º 2
0
        public void InsertElementTest()
        {
            var doc  = new XmlDoc("<root/>");
            var node = doc.InsertBefore(doc.CreateXmlDeclaration("1.0", "utf-8", ""), doc.DocumentElement);

            Assert.IsNotNull(node);

            var firstElement = doc.AddElementText(doc.DocumentElement, "first", "");

            Assert.IsNotNull(firstElement);

            var second = doc.InsertElementBefore(firstElement, "second", "");

            Assert.IsNotNull(second);
        }