Re: Default entities and AT&T

Daniel W. Connolly (connolly@beach.w3.org)
Mon, 24 Jul 95 15:53:33 EDT

In message <950724145451_121803645@aol.com>, Jonsm@aol.com writes:
>The basic question I am asking is: What is the official HTML2 specified way
>of handling undefined entities?
>
>1) it is undefined

#1 is consistent with the HTML2.0 spec.

>2) use SGML processing and return the default entity if defined, null if not.

I'm not sure what you mean here: where does SGML say to "return
null" if there's no #DEFAULT entity? The way I see it, if there
is no #DEFAULT entity, it is an error; i.e. you're back to
case #1.

>3) break with SGML and return the entity name.

If the document has an error, you may do whatever you choose,
including "returning the entity name". This is not "breaking with
SGML." Error recovery is completely up to you.

>I can implement all of the choices but I would like to get a reading on what
>the HTML2 spec says I should do.

After some haggling (see the archives), the HTML 2 spec is silent on
this issue.

As for a reading... you might want to do what everybody else does:
reverse engineer the behaviour of Mosaic/Netscape: these (and many
other implementations) parse "abc &foo; xyz" exactly the same as they
parse "abc &#38;foo; xyz".

> This isn't a case of telling a browser how
>to behave in an error condition since SGML defines what should happen with an
>undefined entity.

Would you cite the evidence that led you to this conclusion? I
disagree. I think section 9.4.4 of the SGML standard is clear enough:

"An entity name is required to be declared by
an entity declaration before it can be used in a named
entity reference, except that an undeclared name
can be used in a general entity reference to refer to
the default entity, if one was defined."

Dan