This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
2.4.2 Item types Rule [49 (formal)] says DocumentType ::= "document" ( "{ Type? "}" )? Do you really mean Type, or do you mean ElementType? For example, I toyed with "document {empty}" as a type notation denoting a document node with no children, or perhaps no elements as children. However, I could not find any rules anywhere to define the meaning of this notation. The closest appears to be 8.2.3.1.2 "Kind tests", but this only defines the semantics of normalizing a DocumentTest, and a DocumentTest only permits an ElementTest as its argument. I also toyed with document { element p:o ? }, document { element p:o * } and document { element p:o + } to mean a document node, all of whose child elements are of type p:o, with different quantifiers specifying the number of occurrences of such child elements. Another notation I considered was document { text } to mean a document node whose only child is a text node. I could not find rules to specify the semantics of these type notations either.
The data model allows document nodes containing several element nodes, text, PI's and comments. So the intent is indeed to have document nodes accepting a general type, with the restriction that there can never be attributes or document nodes. This would be quite heavy to impose that restriction using the grammar, but none of the inference rules can result in such a case so I think we are ok on this. The comment on the 'meaning of types' is more general and recorded as Bug 1616. - Jerome
The working group believes the comment is addressed by the response in additional comment #1, and that there is no change required to the document. - Jerome Simeon On behalf of the XML Query and XSL WGs