RSS 및 XML을 출력 할 때 종종 사용되며 htmlencode와 정확히 동일하지 않습니다.
원칙:
| 성격 | 변환 |
| " | |
| ' | ' |
| &이었다. | &이었다. |
| < | < |
| > | > |
암호
<%
함수 xmlencode (byval stext)
stext = replace (Stext, "&", "&")
stext = replace (stext, "<", "<")
stext = replace (stext, ">", ">")
stext = replace (Stext, " '", "" ")
stext = replace (stext, "" "", "")
xmlencode = Stext
엔드 기능
%>
다른 하나 :
<%
public function xmlencode (byval strtext as String)로 문자열로
Dim Arychars () 변형으로
Arychars = 어레이 (38, 60, 62, 34, 61, 39)
Dim I는 정수로 Dim
i = 0으로 Ubound (Arychars)
strtext = replace (strtext, chr (arychars (i)), "&#"& arychars (i) & ";")
다음
xmlencode = strtext
엔드 기능
%>