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

Re: Why are erroneous ENTITY declarations not caught inXML val

  • From: Liam R E Quin <liam@w3.org>
  • To: David Carlisle <davidc@nag.co.uk>
  • Date: Tue, 23 Oct 2012 13:16:52 -0400

Re:  Why are erroneous ENTITY declarations not caught inXML val
On Tue, 2012-10-23 at 11:51 +0100, David Carlisle wrote:
> On 23/10/2012 11:29, David Carlisle wrote:


> <!ENTITY foo "<![CDATA[ &hhh ]]>" >

David, are those little horns growing on your forehead? :-)

Another awfulness about cdata sections I hadn't thought of before! Hmm,
and thinking about it,
  <!ENTITY start-comment "<!--">
is also allowed, although again you can't use it.

Roger, the answer to your original question comes from SGML - in SGML,
entities were basically over-complicated string macros, and you could
indeed have a start-tag in one entity and a close-tag in another, or
define a "tilde" entity that just contained a combining tilde character,
and then write n&tilde;

We restricted entities in XML, but our goal at the time was to put SGML
on the Web, not to make a new language, and some of the SGML cruft is
still there because we didn't think about removing it.

The right answer, in retrospect, would probably have been that the
replacement text in a general entity should have the same
well-formedness rules as replacement text of an external entity.

There are even weirder rules about parameter entities in XML, because we
wanted to avoid some crazy corner cases that people sometimes did in
SGML, and that made it harder to process SGML documents.

We can't change it now, as we don't want to break existing documents.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Co-author, 5th edition of "Beginning XML", Wrox, Summer 2012



[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.