代码之家  ›  专栏  ›  技术社区  ›  Alister

XML中的转义方字符

  •  1
  • Alister  · 技术社区  · 14 年前

    我创建了一个包含“_2”字符的XML文件。在Internet Explorer中查看文档时,会出现“无效字符”错误。_2需要逃跑吗?或者这只是IE8的问题。XML的实际位如下所示:

    <Text>ATTENTION INVESTORS &amp; DEVELOPERS
    920m² freehold site on 2 titles consisting of vacant land and adjoining buildings. Located within the CBD this is one of the last sites available with frontages on both Marine Parade and Hastings Street, Napier. Zoned inner city commercial.  
    Contact agents for details.
    </Text>
    
    1 回复  |  直到 14 年前
        1
  •  4
  •   Mark Biek    14 年前

    您应该能够使用HTML实体样式引用(就像使用 &amp; )

    我想 &#xb2; &#178; 应该工作。

    看看编码列表 here .