OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: newbie question: using < in entity declaration

[ Lists Home | Date Index | Thread Index ]
  • From: richard@cogsci.ed.ac.uk (Richard Tobin)
  • To: xml-dev@xml.org
  • Date: 30 Jun 2000 12:33:36 GMT

Sarveshwar Rao Duddu <duddu@vsnl.com> wrote:

>I have a doubt in whether or not it is legal to declare something like:
><!ENTITY lt "<">

Short answer: it's not legal.

Long answer:

There are actually two issues here: whether any entity can be declared
like that, and whether the entity "lt" can be.


  <!ENTITY mylt "<">

This declaration itself is legal, but any use of it will inevitably
not be.  This is because to be well formed, an internal general parsed
entity must match production [43] (content), and for a document to be
well formed all the parsed entities it references must be well formed.

The declaration

 <!ENTITY lt "<">

is an error.  It's not a fatal error, so a parser need not report it;
I think the justification for this is that a parser can just ignore
the declarations of the predefined entities.

That it's an error is not entirely clear from section 4.6 (it's
possible to interpret the definitions given there as merely examples),
but will be clarified in an erratum that has not yet been published:

  If the entities lt or amp are declared, they must be declared as
  internal entities whose replacement text is a character reference to
  the character being escaped; the double escaping is required for
  these entities so that references to them produce a well-formed
  result. If the entities gt, apos or quot are declared, they must be
  declared as internal entities whose replacement text is the single
  character being escaped (or a character reference to that character;
  the double escaping here is unnecessary but harmless).

-- Richard
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

"The Internet is really just a series of bottlenecks joined by high
speed networks." - Sam Wilson

This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/


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

Copyright 2001 XML.org. This site is hosted by OASIS