温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:MyWebPages51aspx汉化最终版
当前文件:
MyWebPagesStarterKit/App_Code/FCKEditor/XmlUtil.cs,打开代码结构图
MyWebPagesStarterKit/App_Code/FCKEditor/XmlUtil.cs,打开代码结构图1/* 2
* FCKeditor - The text editor for internet 3
* Copyright (C) 2003-2005 Frederico Caldeira Knabben 4
* 5
* Licensed under the terms of the GNU Lesser General Public License: 6
* http://www.opensource.org/licenses/lgpl-license.php 7
* 8
* For further information visit: 9
* http://www.fckeditor.net/ 10
* 11
* "Support Open Source software. What about a donation today?" 12
* 13
* File Name: XmlUtil.cs 14
* Useful tools for XML. 15
* 16
* File Authors: 17
* Frederico Caldeira Knabben (fredck@fckeditor.net) 18
*/ 19
20
using System ; 21
using System.Globalization ; 22
using System.Xml ; 23
24
namespace FredCK.FCKeditorV2 25
{ 26
internal sealed class XmlUtil 27
{ 28
private XmlUtil() 29
{} 30
31
public static XmlNode AppendElement( XmlNode node, string newElementName ) 32
{ 33
return AppendElement( node, newElementName, null ) ; 34
} 35
36
public static XmlNode AppendElement( XmlNode node, string newElementName, string innerValue ) 37
{ 38
XmlNode oNode ; 39
40
if ( node is XmlDocument ) 41
oNode = node.AppendChild( ((XmlDocument)node).CreateElement( newElementName ) ) ; 42
else 43
oNode = node.AppendChild( node.OwnerDocument.CreateElement( newElementName ) ) ; 44
45
if ( innerValue != null ) 46
oNode.AppendChild( node.OwnerDocument.CreateTextNode( innerValue ) ) ; 47
48
return oNode ; 49
} 50
51
public static XmlAttribute CreateAttribute( XmlDocument xmlDocument, string name, string value ) 52
{ 53
XmlAttribute oAtt = xmlDocument.CreateAttribute( name ) ; 54
oAtt.Value = value ; 55
return oAtt ; 56
} 57
58
public static void SetAttribute( XmlNode node, string attributeName, string attributeValue ) 59
{ 60
if ( node.Attributes[ attributeName ] != null ) 61
node.Attributes[ attributeName ].Value = attributeValue ; 62
else 63
node.Attributes.Append( CreateAttribute( node.OwnerDocument, attributeName, attributeValue ) ) ; 64
} 65
} 66
} 67



* FCKeditor - The text editor for internet

}