源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

ASP常用函数:XMLEncode

  • 时间:2021-05-18 13:46 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:ASP常用函数:XMLEncode
输出RSS和XML时经常用到,和HTMLEncode还不完全一样 原理:
[b]Character[/b] [b]Converted To[/b]
" "
' '
& &
< <
> >
代码 <% 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(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 %>
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部