OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Are elements allowed to nest within themselves?

[ Lists Home | Date Index | Thread Index ]
  • From: "Richard L. Goerwitz III" <richard@goon.stg.brown.edu>
  • To: xml-dev@ic.ac.uk
  • Date: Wed, 9 Sep 1998 20:27:02 -0400

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

  http://www.stg.brown.edu/service/xmlvalid/

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* )>
<!ATTLIST foo answer CDATA #IMPLIED>
<!ELEMENT bar (#PCDATA)>
]>

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

Richard Goerwitz
Brown University


xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS