[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [saxon] Why are erroneous ENTITY declarations not caught in validation?
- From: "Christopher R. Maden" <crism@maden.org>
- To: saxon-help@lists.sourceforge.net, xml-dev@lists.xml.org
- Date: Tue, 23 Oct 2012 05:50:07 -0400
[copying xml-dev in media res, since the conversation is there now, too]
On 10/23/2012 03:48 AM, Michael Kay wrote:
> I thought I remembered seeing something like that. But I don't see
> anything in the sections you cite that appears to override:
>
> <quote> Well-formedness constraint: Entity Declared
>
> In a ... document with only an internal DTD subset which contains
> no parameter entity references ..., for an entity reference that
> does not occur within the external subset or a parameter entity,
> the Name given in the entity reference must match that in an
> entity declaration that does not occur within the external subset
> or a parameter entity, except that well-formed documents need not
> declare any of the following entities: amp, lt, gt, apos, quot.
> </quote>
>
> #intern-replacement does say that the entity reference is not
> immediately replaced by the content of the corresponding entity
> declaration, but it doesn't appear to say anything that overrides
> #wf-entdeclared, which I read as saying that the corresponding
> entity declaration must exist.
As David Carlisle said, some of this is implicit inclusion of SGML
rules, which seemed obvious to everyone at the time...
Attempting to re-read the well-formedness constraint more carefully, I
think you’re right. I can’t see any way that an undeclared reference
in the internal subset is allowed.
I suspect simple lazy implementation; since the references are not
expanded until they are used, checking is overhead... Still, it does
seem like the kind of error that XML’s draconian rules were intended
to help prevent. Interesting that this widespread bug has slipped by
for so long. Good catch, Roger.
~Chris
--
Chris Maden, text nerd <URL: http://crism.maden.org/ >
LIVE FREE: vote for Gary Johnson, Libertarian for President.
<URL: http://garyjohnson2012.com/ > <URL: http://lp.org/ >
GnuPG fingerprint: DB08 CF6C 2583 7F55 3BE9 A210 4A51 DBAC 5C5C 3D5E
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]