欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

ASP常用函數(shù):XMLEncode

 更新時(shí)間:2007年02月07日 00:00:00   作者:  

輸出RSS和XML時(shí)經(jīng)常用到,和HTMLEncode還不完全一樣

原理:

Character Converted To
" "
' '
& &
< &lt;
> &gt;

代碼
<%
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
%>
還有個(gè):
<%
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
%>

相關(guān)文章

最新評(píng)論