Re: C.4 Undeclared entities? [CDATA #REQUIRED?]
At 12:01 1996-10-18 GMT, Charles wrote:
>On Thu, 17 Oct 96 13:20:13 CDT, Michael Sperberg-McQueen
>>On 23 October 1996, the ERB will vote to decide the following
>>question. A straw poll indicates the ERB is leaning to declaring
>>only lt, gt, and amp automatically and making references to
>>undeclared entities be a reportable error.
>>C.4 if XML makes DTDs optional and allows partial DTDs, what must or
>>may a parser do when it encounters references to undeclared entities
>>(9.4)? Should XML declare any set of entities automatically?
>Questions like this are more easily analyzed if we avoid the confusing term
>"optional DTD". A missing DTD is really an implied DTD (like SGML's implied
>Declaration) in which all element types have mixed content consisting of
>"(#pcdata | any element type)*" and all attributes are CDATA #REQUIRED (except
>for special conventions for ID, etc. that we might adopt).
How can all attributes be CDATA #REQUIRED, when I suspect that many
tags will omit attributes for some occurrences, and include them for others.
In most SGML applications I believe #IMPLIED is the most common default.
An implied DTD can provide minimum semantic interpretation of any attribute,
unless the attribute name suggests its semantics, such as ID would, or
possibly the form of the attribute value, such as a valid URL might.
So, the other attributes whether present or omitted can have effect on some
associated style sheet, where an implied action would be overridden by
an explicit attribute value.
>So there is always a DTD. Now the question is: what does a parser do with
>references to undeclared entities? There is no reason to do anything different
>from what is done in SGML.
An undeclared entity could be passed on to the application, and possibly
retained as such when part of #PCDATA.
>As for declaring entities automatically, I assume that means there will be a
>piece of public text containing the "automatic" declarations that is considered
>to be referenced by all DTDs (including the implied one). Or, to put it another
>way, all DTDs are partial; the "automatic" entity declarations are the other
That "automatic" set of entity declarations is open-ended, effectively any
apparent entity should be in it.