In article <bd*************************@posting.google.com> ,
tfsquare <tf******@yahoo.com> wrote:
% Baldo,
%
% > a main NODE is an "HAVE TO":
% >
% > <ROOT>
% > <FOO>foo.top.level</FOO>
% > ....
% > </ROOT>
%
% When you say "HAVE TO" do you mean XSLT and/or XPath demands this,
% perhaps as specified in a RFC? That would be interesting. Of course
XML and related technologies are defined in w3c recommendations (and
oasis specifications) rather than RFCs. The most important XML recommendation
is `Extensible Markup Language (XML) 1.0', which you can find at
http://www.w3.org/TR/REC-xml
The most important concept described in that recommendation is
well-formedness. The rules for a well-formed document are reasonably
simple (this is taken from the second edition, but I don't think the
wording changed in the third edition):
[Definition: A textual object is a well-formed XML document if:]
1. Taken as a whole, it matches the production labeled document.
2. It meets all the well-formedness constraints given in this
specification.
3. Each of the parsed entities which is referenced directly
or indirectly within the document is well-formed.
I'm not going to quote the document production because it doesn't stand on
its own, but the recommendation explicitly states some implications of
matching it:
Matching the document production implies that:
1. It contains one or more elements.
2. [Definition: 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.
[Definition: 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.]
The second implication is what's meant by `HAVE TO'. If you have more
than one top-level element, you have more than one XML document.
--
Patrick TJ McPhee
East York Canada
pt**@interlog.com