Create Xml Attribute, Node
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
public static class XmlUtility
{
public static XmlAttribute CreateAttribute(XmlDocument _xmlDocument, string _attributeName, string _value)
{
XmlAttribute _attribute = _xmlDocument.CreateAttribute(_attributeName);
_attribute.Value = _value;
return _attribute;
}
public static XmlElement CreateXmlNode(XmlDocument _xmlDocument, string _nodeName)
{
XmlElement _node = _xmlDocument.CreateElement(_nodeName);
return _node;
}
public static XmlElement CreateXmlNode(XmlDocument _xmlDocument, string _nodeName, XmlNode _childNode)
{
XmlElement _node = _xmlDocument.CreateElement(_nodeName);
_node.AppendChild(_childNode);
return _node;
}
}
Related examples in the same category