using System;
using System.Xml;
namespace WLERP.Common.Util
{
/// <summary>
/// Xml 操作工具類
/// </summary>
public sealed class XmlUtil
{
private XmlUtil() { }
/// <summary>
/// 創建節點
/// </summary>
/// <param name="node"></param>
/// <param name="newElementName"></param>
/// <returns></returns>
public static XmlNode AppendElement(XmlNode node, string newElementName)
{
return AppendElement(node, newElementName, null);
}
/// <summary>
/// 創建節點
/// </summary>
/// <param name="node"></param>
/// <param name="newElementName"></param>
/// <param name="innerValue"></param>
/// <returns></returns>
public static XmlNode AppendElement(XmlNode node, string newElementName, string innerValue)
{
XmlNode oNode;
if (node is XmlDocument)
{
oNode = node.AppendChild(((XmlDocument)node).CreateElement(newElementName));
}
else
{
oNode = node.AppendChild(node.OwnerDocument.CreateElement(newElementName));
}
&