XML 中的转义方形字符

发布于 2024-09-30 21:24:13 字数 472 浏览 0 评论 0原文

我创建了一个包含“²”字符的 XML 文件。在 Internet Explorer 中查看文档时,出现“无效字符”错误。是否需要以某种方式转义?或者这只是 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>

I've created an XML file that contains the "²" character. When viewing the document in Internet Explorer, I get an "Invalid Character" error. Does ² need to be escaped somehow? or is this just an issue with IE8. The actual bit of XML is shown below:

<Text>ATTENTION INVESTORS & 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>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生生不灭 2024-10-07 21:24:13

您应该能够使用 HTML 实体样式引用(就像您对 & 所做的那样)。

我认为 ²² 应该可以。

此处查看编码列表。

You should be able to use an HTML entity-style reference (like you did with &).

I think ² or ² should work.

Take a look at the list of encodings here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文