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


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: DTD Question - PCDATA followed by an optional element

[ Lists Home | Date Index | Thread Index ]
  • From: kragen@pobox.com (Kragen Sitaker)
  • To: xml-dev@ic.ac.uk
  • Date: Wed, 17 Nov 1999 18:16:58 -0500 (EST)

Norman Samuelson asks:
>To include the comment, I would like to be able to simply say:
>   <!ELEMENT comment (#PCDATA)>
>   <!ELEMENT rho0 (#PCDATA, comment?)>
>That doesn't seem to be acceptable.  I also tried:
>   <!ELEMENT rho0 ((#PCDATA) | (#PCDATA, comment))>
>Is it possible to do what I want?

No.  Section 3.2.2 of REC-xml:
	An element type has mixed content when elements of that type
	may contain character data, optionally interspersed with child
	elements. In this case, the types of the child elements may be
	constrained, but not their order or their number of

The best you can do is (#PCDATA|comment)*.

<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
The Internet stock bubble didn't burst on 1999-11-08.  Hurrah!

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/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@ic.ac.uk the following message;
unsubscribe 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