Re: XML FAQ: some questions

On Tue, 18 Feb 1997 10:09:27 -0500 Peter Flynn said:
>A couple of unanswered questions that I'd like to pre-empt:
>BTW is there a more recent spec that 961114? I trawled the logs
>but I couldn't see a reference.

Not yet.  Soon, we hope.

>1. What *may*, and what *must* precede the root element in a
>   well-formed XML document? The spec isn't very clear
>   on which PIs are compulsory and which are optional.

I read productions 27-31 as meaning:
  - the root element must be preceded by a prolog
  - the prolog must begin with an XML declaration
    i.e. <?XML version='1.0' ... ?>
  - the prolog may contain PIs, comments, one document type
    declaration, and white space, following the XML declaration

Which part of this isn't clear from the spec?

>2. How may entities be used in XML? ie whether general
>   entities can be included and to what depth.

Yes, general entities may be used.  No depth restriction is made.

>3. The restriction in WF documents on what elements may occur
>   within what others is not clear (3.2):
>      As a consequence of this, for each non-root element C,
>      there is one other element P such that C is in the content of P,
>      but is not in the content of any other element
>      that is in the content of P.
>      Then P is referred to as the parent of C, and C as the child of P.
>   Here's a non-root element C which we call PARA in some DTD or other.
>   There is _an_other element (not _one_ other) P which we call SECT.
>   PARA is in the content of SECT. So far so good.
>   But SECT has in its content also an element called NOTE.
>   NOTE has PARA in its content model.

The paragraph quoted is referring to the elements (instances), not
to their types; to actual containment, not potential containment.
A PARA contained directly within a NOTE has exactly one parent element:
the NOTE.  The fact that other PARA elements have or can have
parents with GIs other than NOTE does nothing to change the
nature of the parent-child relationship.

-C. M. Sperberg-McQueen
 ACH / ACL / ALLC Text Encoding Initiative
 University of Illinois at Chicago