Re: Order of Declarations in DTD subsets

James Clark (jjc@jclark.com)
Mon, 22 Dec 1997 16:28:38 +0700


Peter Murray-Rust wrote:
>
> Is it required that a declaration in the subset come before it is used?

In general no. The exceptions are that parameter entities must be
declared before they are referenced and general entities must be
declared before they are referenced within default attribute values
(this is specified under Well-Formedness Constraint - Entity Declared).
In particular it is *not* required:

- to declare an element type before it is used in content model

- to declare an element type before it is used in an attlist declaration

- to declare a notation before its name is used as the default value for
a NOTATION attribute

- to declare a notation before it is used as the notation for an
unparsed entity

- to declare an unparsed entity before its name is used in the value for
an ENTITY or ENTITIES attribute

- to declare a general entity before it occurs in an EntityValue

James