Add XmlElement : XmlDocument « XML « C# / C Sharp






Add XmlElement

  
//Microsoft Public License (Ms-PL)
//http://dbmlmanager.codeplex.com/license

#region using
using System;
using System.Xml;
#endregion

namespace DbmlManager.Lib.Utility
{
  #region Class Docs
  /// <summary>
  /// Summary description for XmlUtil.
  /// </summary>
  #endregion

  public class XmlUtil
  {


    // Public Static Methods

    #region AddXmlElement(XmlDocument xml, XmlNode parent, string nodeName, string nodeText)
    public static void AddXmlElement(XmlDocument xml, XmlNode parent, string nodeName, string nodeText)
    {
      XmlElement node = xml.CreateElement(nodeName);
      node.InnerText = nodeText;
      parent.AppendChild(node);
    }
    #endregion

  }
}

   
    
  








Related examples in the same category

1.A Simple XML Example
2.LoadXml
3.Save, AppendChild, CreateXmlDeclaration, CreateElement
4.Call GetElementsByTagName to get an element
5.Use Load method in XmlDocument to load xml document
6.Use SelectNodes to query nodes by XPath
7.Get XML Nodes in a Specific XML Namespace
8.Find Elements with an XPath Search
9.Load With Includes
10.Non CData Normalize