XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Weird XML rules

On Thursday, Liam Quin wrote:

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

If the word "numeric" is removed from that sentence does the sentence still hold true? That is, _all_ character references are treated as data, not markup. True? For example, just as the numeric character reference < is always treated as data, so too the XML character reference < is always treated as data. What that means is:

<Test foo="&#x3C;"/>
<Test foo="&lt;"/>

are both legal. 

To an XML-aware tool, the following all denote the same character. More precisely, they all denote the same code point.

<
&lt;
&#x3C;
&#x3c;
&#x60;

And yet, they are treated differently:

< is illegal in an attribute value because < is treated as markup. But the entity versions are legal in an attribute value because they are treated as data.

< is illegal in an element value because < is treated as markup. But the entity versions are legal in an element value because they are treated as data.

Is this correct?

So, the same character is treated differently purely because of the way the character is lexically represented.

Isn't that weird?

Is there ever a case where an entity version is not treated as data; rather, it is treated as markup?

/Roger


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS