Can literal angle brackets be used in quoted XML attribute value strings?

旧巷老猫 提交于 2019-12-02 11:35:49

问题


For example, is this valid XML?:

<foo bar="3<5" />

Or do I have to escape them?:

<foo bar="3&lt;5" />

回答1:


You have to escape the literal <.

You can check this using any XML Validator.



来源:https://stackoverflow.com/questions/13687998/can-literal-angle-brackets-be-used-in-quoted-xml-attribute-value-strings

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!