3 Logical Structures
Logical Structures
Each XML Document contains one or more elements, the boundaries
of which are either delimited by Start-Tag
and End Tag, or, for Empty
elements, by an empty-element tag. Each
element has a type, identified by name, sometimes called its "generic
identifier" (GI), and MAY have a set of attribute specifications.
Each attribute specification has a Attribute Name
and a Attribute Value.
Element
This specification does not constrain the semantics, use, or (beyond syntax)
names of the element types and attributes, except that names beginning with
a match to (('X'|'x')('M'|'m')('L'|'l')) are reserved for standardization
in this or future versions of this specification.
Well Formedness Constraint: Element Type Match
Element Type Match
The Name
in an element's end-tag MUST match the element type in the start-tag.
Validity Constraint: Element Valid
Element Valid
An element is valid
if there is a declaration matching elementdecl
where the Name matches the element type, and one of
the following holds:
-
The declaration matches EMPTY and the element has no Content (not even entity
references, comments, PIs or white space).
-
The declaration matches children and the
sequence of Parent/Child belongs
to the language generated by the regular expression in the content model,
with optional white space, comments and
PIs (i.e. markup matching production [27] Misc) between the
start-tag and the first child element, between child elements, or between
the last child element and the end-tag. Note that a CDATA section containing
only white space or a reference
to an entity whose replacement text is character references expanding to white
space do not
match the nonterminal S, and
hence cannot appear in these positions; however, a
reference to an internal entity with a literal value consisting of character
references expanding to white space does match S, since its
replacement text is the white space resulting from expansion of the character
references.
-
The declaration matches Mixed and the content
(after replacing
any entity references with their replacement text) consists of
Character Data,
Comment, Processing instruction and Parent/Child whose types match names in the
content model.
-
The declaration matches ANY, and the
content
(after replacing
any entity references with their replacement text)
consists of character data and Parent/Child
whose types
have been declared.
|