Are elements allowed to nest within themselves?

Richard L. Goerwitz III richard at
Thu Sep 10 02:27:15 BST 1998

Just for future reference, this sort of question is easily
answered by a validator.  E.g., go to

and paste in a brief document like the one you posted be-
fore (with a few bits of sugar to make it taste good to
the validator):

<!DOCTYPE foo [
<!ELEMENT foo ( foo*, bar* )>

<!-- top-level "foo" element -->
     <!-- first nested "foo" element -->
     <foo answer="yes">
          <bar>this one</bar>
          <bar>that one</bar>
     <!-- second nested "foo" element -->
     <foo answer="no">
          <bar>the other one</bar>
     <!-- third nested "foo" element (empty) -->

Richard Goerwitz
Brown University

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as:
To (un)subscribe, mailto:majordomo at the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list