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


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: Unparsed entity reference in entity value?

[ Lists Home | Date Index | Thread Index ]
  • From: richard@cogsci.ed.ac.uk (Richard Tobin)
  • To: xml-dev@xml.org
  • Date: 13 Jun 2000 22:28:00 GMT

Rainer M. Schmid <rms@trolltech.com> wrote:

><!DOCTYPE doc [
><!ENTITY e "<![CDATA[&foo;]]>">

>According to the testsuite this should be a valid XML document. But if I
>look at the table in the XML specification on how entity references should
>be parsed, it should be forbidden (Entity Type: Unparsed and Reference in
>Entity Value).

It's not an unparsed entity - that's an entity declared with a
notation.  But you're right that there's something fishy here: there
is no need for foo to be declared before e, or ever declared, so the
parser can't check to see whether it's parsed or unparsed (it could
check after the DTD has all been read, but I don't think that's
reasonable).  Of course, there's the more obvious point that &foo;
won't turn out to be an entity reference at all.

The obvious fix is to change the entry in the table in 4.4 to be

One might ask why "bypassed" exists at all, rather than using "not
recognised".  I'd guess it's because the parser has to look at &
anyway in case it's a character reference.  It does seem to make a
difference - if the putative entity reference has to syntactically
correct, it would make this not well-formed:

  <!DOCTYPE foo [
  <!ENTITY e "<![CDATA[&=]]>">

I suppose this is another one for the erratum list.

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