[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Weird XML rules

  • From: Roger L Costello <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Sat, 19 Mar 2022 13:45:36 +0000

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 &#x3C; is always treated as data, so too the XML character reference &lt; 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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.