asp学习网: 首页 >> 杂项 >> xml与asp应用 >> asp函数转换xml中的实体字符[转义符]

asp函数转换xml中的实体字符[转义符]

<%
Function XMLEncode(byVal sText)
sText = Replace(sText, "&" , "&amp;")
sText = Replace(sText, "<" , "&lt;")
sText = Replace(sText, ">" , "&gt;")
sText = Replace(sText, "'" , "&apos;")
sText = Replace(sText, """", "&quot;")
XMLEncode = sText
End Function
%>

或者

<%
Public Function XmlEncode(strText)
Dim aryChars
aryChars = Array(38, 60, 62, 34, 61, 39)
Dim i
For i = 0 To UBound(aryChars)
strText = Replace(strText, Chr(aryChars(i)), "&#" & aryChars(i) & ";")
Next
XmlEncode = strText
End Function
%> from:asp学习网/title:asp函数转换xml中的实体字符[转义符]/ time:2007-12-31 21:59:08

本文主题转义符,xml

ArrayToxml函数:数组转化为xml

ASP通过XMLDom在服务器端操作XML文件的主要方法和实现

.net应用xmlhttp

将asp程序制作成为安装版:xml打包和解包

XMLHttpRequest对象全面解析

XML转义符和空白字符

XMLDOM手册

asp操作xml的主要方法

asp教程 ©2006-2007 aspxuexi.com | 关于站点 | 版权隐私 | 站内搜索
复制或者翻版 请于夜间进行