xml 转义
记录
复杂且错误方案
< --> &lt;
> --> <
gcs:<
html --> gcs
原模原样
< <
< <
& &
gcs-html
< < 3
> > 3
" " 3
' ' 3
& & 3
" &quot; 2
> &gt; 2
' &#39; 2
< &lt; 2
& &amp; 1
1-->3 代码书写顺序
&quot;
<&<
<&amp;&lt;
例子
<script>alert('test');</script>
<
<
<>"
<&quot;
<script>alert('test');</script>
<
&lt;
<>&quot;
&amp;quot;
<&amp;quot;
&lt;
<>&quot;
<&amp;quot;
简单且正确方案
< < 2
> > 2
" " 2
' ' 2
& & 1
例子
<script>alert('test');</script>
<
<
<>"
<&quot;
<script>alert('test');</script>
<
&lt;
<>&quot;
<&amp;quot;