Why does XML not allow the "<" character in an attribute value? Since all attribute values are in quotes, the "<" character can't create any parsing ambiguity. And if the "<" character is not allowed, why is the ">" character allowed? This is a well-formed XML file:
I think the reasons are consistency and simplicity. As the specification says -
The ampersand character (&) and the left angle bracket (< may appear in their literal form only when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section. If they are needed elsewhere, they must be escaped ...
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
As Dan says, I think simplicity is a big factor. Having occasionally worked with large XML documents, that we parsed ourselves, treating them as a String - for example, when we just wanted to find the content of the first element after a certain tag - you didn't necessarily keep track of all the characters - you just looked for a < to delimit that next element. So even though, looking at the XML, it's easy to see that < is within quotes and therefore unambigious, I suspect that many parsers will not necessarily take account of those quotes when dealing with the < character. Some people prefer to use an escape character for > as well, although there's no reason to do so, apart from consistency. It may seem very bad practice to just look for the < character to find a new tag but sometimes we found it necessary for performance reasons or to identify specific information before we parsed the XML properly, such as the company or type of XML document we were dealing with. Hope this helps, Kathy