[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Undeclared elements error

  • From: "Richard L. Goerwitz III" <richard@g...>
  • To: xml-dev@i...
  • Date: Thu, 17 Sep 1998 08:45:10 -0400 (EDT)

a bold undeclared
> Liam R. E. Quin wrote:
> 
> > Should the following produce a warning?
> > 
> >     <!ELEMENT CHAPTER (LOCATION,DESCRIPTION)>
> >     <!--* error: LOCATION has not been declared *-->
> >     <!--* error: DESCRIPTION has not been declared *-->
> > 
> >     <!ELEMENT LOCATION (#PCDATA)>
> >     <!ELEMENT DESCRIPTION (#PCDATA)>
> 
> Absolutely not.

In an attempt to flesh out James Clark's somewhat abrupt note, let
me just give you a quick example illustrating why your intuitions
were right about it being okay to use element names in content models
before they are declared:

  <!ELEMENT text (#PCDATA | italic | bold)*>
  <!ELEMENT italic (#PCDATA | bold)*>
  <!ELEMENT bold (#PCDATA | italic)*>

Other questions you might wonder about include:

  1) What if I use an element in a content model and I don't
     declare it?
  2) What if I declare an element in a content model that I
     don't use in any content model (and the element isn't the
     root element)?

By my reading of the XML spec, these are not clearly stated to be
errors.  So they aren't errors (unless you try to use the elements
in a document - in which case, other constraints exclude them).

I may have missed something, of course.

In such situations, it's tempting to cheat and just use your know-
ledge of SGML.  One would hope that future standards will answer
such questions definitively, removing this temptation (confusion).

Richard Goerwitz
STG


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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.