Hi Joe,

I am well aware that multiple top-level elements are not allowed.  I have
been using XML for about 2 years or so now and thought I was quite familiar
with it until a colleague asked why IE didn't break when he gave the sample
document I gave.  I had read the W3C Recommendation several times before and
I always read the well-formedness definition the same way: no part of the
*unique* root element may appear anywhere else in the document - the root
element's name being a part of that element.  If it's not part of the
element, what is an XML element without a name?

So I was compelled to write to the most knowledgeable group I know on the
matter (xerces-j-user and xerces-j-dev) to get a definitive answer which
I've gotten.

I'm fairly certain that in the past I've encountered DTDs that did not allow
the root element to exist anywhere within the document and that only
reaffirmed my understanding that a single document element must exist that
contains all other elements and cannot exist anywhere within itself.

Brion

-----Original Message-----
From: Joseph Kesselman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 12, 2003 9:31 AM
To: [EMAIL PROTECTED]
Subject: RE: basic XML question re: Xerces


What is "not allowed" is for there to be more than one top-level element:
        <foo/>
        <bar/>
(with or without additional content within those elements, and no matter 
what their names are), or indeed *anything* other than the XML 
Declaration, doctype declaration, comments, PI's, and whitespace  outside 
that one top-level element.

A good XML tutorial *should* make this clear. If yours didn't, I'd suggest 
switching books.

______________________________________
Joe Kesselman  / IBM Research


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to