2.1 Well-Formed XML Documents
Well-Formed XML Documents
A textual object is a well-formed
XML document if:
-
Taken as a whole, it matches the production labeled document.
-
It meets all the well-formedness constraints given in this specification.
-
Each of the Text Entity
which is referenced directly or indirectly within the document is Well-Formed.
Document
Matching the document production implies that:
-
It contains one or more Element.
-
There is exactly one element,
called the root, or document element, no part of which appears
in the Content of any other element. For
all other elements, if the Start-Tag is in
the content of another element, the End Tag
is in the content of the same element. More simply stated, the elements,
delimited by start- and end-tags, nest properly within each other.
As a consequence of this,
for each non-root element C in the document, there is one other element P
in the document 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. P
is referred to as the parent of C, and C as
a child of P.
|