转义的尖括号中的XML在Eclipse / Android的 [英] Escaping Angle Brackets in XML in Eclipse / Android

查看:540
本文介绍了转义的尖括号中的XML在Eclipse / Android的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想标记的一些按钮>和<符号,什么是逃跑出来的XML文件中的正确方法是什么?的presence要么>或&放大器; (如&放大器; GT)。生产无效令牌错误

If I want to to label some buttons with ">" and "<" symbols, what's the correct way to escape them out in the XML file? The presence of either ">" or "&" (as in "&gt") produces "invalid token" errors.

在此先感谢。

推荐答案

请指定这些字符是这样的:

Either specify those characters like this:

< = &lt;
> = &gt;

或者使用CDATA节,并把这些字符内:

Or use a CDATA section and put those characters inside:

<![CDATA[<]]>
<![CDATA[>]]>

这篇关于转义的尖括号中的XML在Eclipse / Android的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆