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]
Re: [xml-dev] Why are erroneous ENTITY declarations not caught inXML validation?

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]


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