Matt
Matt

Reputation: 22133

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

For example, is this valid XML?:

<foo bar="3<5" />

Or do I have to escape them?:

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

Upvotes: 1

Views: 1225

Answers (1)

R Kaja Mohideen
R Kaja Mohideen

Reputation: 917

You have to escape the literal <.

You can check this using any XML Validator.

Upvotes: 1

Related Questions