Re: Why is < illegal in an attribute value but the equivalent hex and decimal character entities are legal?

Roger L Costello <[email protected]>
Newsgroups gmane.text.xml.devel
Message-ID <SA9PR09MB5952A2BE7A473F0F0CFBCFBDC8129@SA9PR09MB5952.namprd09.prod.outlook.com>
In response to my question:

1. Why is it that < is illegal but the equivalent hex
and decimal character entities are legal?

Liam Quin answered:

Because numeric character references are always 
treated as data when they are read, not markup.

Ah!!!!!!!!!!

So this is perfectly well-formed XML:

<Test foo="&#x3C;x>blah&#x3C;/x>"/>

And the numeric character references will be replaced during the parsing process to yield this:

<Test foo="<x>blah</x>"/>

Correct?

/Roger
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.