以下为引用的内容:
<%
Function XMLEncode(byVal sText)
sText = Replace(sText, "&" , "&")
sText = Replace(sText, "<" , "<")
sText = Replace(sText, ">" , ">")
sText = Replace(sText, "." , "'")
sText = Replace(sText, """", """)
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
%>
上下篇: Asp获取当日文章并支持前一天后一天的方法 ASP分页和日期格式化为RFC822格式的办法