Create a property XML element. Do not append it though! - CSharp System.Xml

CSharp examples for System.Xml:XML Element

Description

Create a property XML element. Do not append it though!

Demo Code

// Licensed under the Apache License, Version 2.0 (the "License");
using System.Xml;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//w  w w  .  j ava 2  s.c o m

public class Main{
        /// <summary>
        /// Create a property element.  Do not append it though!
        /// </summary>
        /// <param name="doc">The document to use.</param>
        /// <param name="name">The name of the property.</param>
        /// <param name="value_ren">The value to add to the property.</param>
        /// <returns>The newly created property.</returns>
        public static XmlNode CreateProperty(XmlDocument doc, String name,
                 String value_ren)
        {
            XmlNode n = doc.CreateElement(name);
            n.AppendChild(doc.CreateTextNode(value));
            return n;
        }
}

Related Tutorials