Character | Converted To |
" | quot; |
' | apos; |
lt; | |
> | gt; |
代碼
%
Function XMLEncode(byVal sText)
sText = Replace(sText, "" , "")
sText = Replace(sText, "" , "lt;")
sText = Replace(sText, ">" , "gt;")
sText = Replace(sText, "'" , "apos;")
sText = Replace(sText, """", "quot;")
XMLEncode = sText
End Function
%>
還有個:
%
Public Function XmlEncode(ByVal strText As String) As String
Dim aryChars() As Variant
aryChars = Array(38, 60, 62, 34, 61, 39)
Dim i As Integer
For i = 0 To UBound(aryChars)
strText = Replace(strText, Chr(aryChars(i)), "#" aryChars(i) ";")
Next
XmlEncode = strText
End Function
%>
標(biāo)簽:朝陽 平頂山 馬鞍山 孝感 防城港 湖北 四平 遼陽
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP常用函數(shù):XMLEncode》,本文關(guān)鍵詞 ASP,常用,函數(shù),XMLEncode,ASP,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。