如果在MXML中使用类似下面的代码
<mx:Button enabled="{a && b}"/>
会出现这样的错误
"The entity name must immediately follow the '&' in the entity reference."
一开始我还以为是bug,网上搜了搜才知道似乎是xml的规范中 & 符号需要转义
解决方法:
<mx:Button enabled="{a && b}"/>
mxml也就是xml,有些特殊字符是不能直接写的,不然就破坏xml的结构了。下面就是需要转义的字符。
< | < |
> | > |
& | & |
“ | " |
‘ | ' |