Can literal angle brackets be used in quoted XML a

2019-03-01 02:43发布

问题:

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.



标签: xml escaping