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

RE: Inheritance between DTD's ?

  • From: "Rick Jelliffe" <ricko@a...>
  • To: "XML Dev" <xml-dev@i...>
  • Date: Tue, 23 Jun 1998 02:41:57 +1000

first in best dressed meaning
> From: James H. Blackwell Jr.

> Is there any sort of "Inheritance" between DTDs ?  For example, say you
> have some smaller DTDs and wish to merge them into another larger DTD
> that is more specific.
>
> If the same tag definition exists between the smaller DTDs or between
> the larger DTD and one you wish to include within it, does the tag
> definition that comes first in the DTD rule ?

First in best dressed, as far as declarations go. First declaration has
precedence. (That way declarations in the "internal subset" override
declarations in the "external subset".)

There is no idea of inheritence in XML DTDs. The model is of textual
inclusion; use the same "entity" model as the instance (though with a more
reader-friendly and consise syntax: I am always surprised at people who
complain about content model syntax, and yet use a BNF in their own
specifications :-).

If you want to combine two DTDs which use the same names for any element
types, then you must either combine their content models, which often is not
practical, or to rename one or both elements. There is a draft namespaces
proposal almost finalized now: it is basically a convention for giving a URN
to a particular vocabulary of names, and then, on a per document basis,
renaming the appropriate names in the document using a prefix which invokes
the URN. So you find out the URN to HTML, you decide in your documents to
use the prefix "HTML3:" and make a "namespace declaration" to bind that
prefix to the URN for that document, and then you rename al your ambiguous
element names by prefixing them: i.e. "<HTML3:p>"



Rick Jelliffe

P.S. There is a mechanism you can use which will allow you to do what people
use inheritance to do: to be able to say "x is a y" or "x is a y but it also
has z". It in effect says "the content model of x is the same content model
as y" or "the content model of x is the same content model as y but it also
has a z". You do this by putting the content model of x in a parameter
entity, rather than directly. You do the same thing with the attribute
declarations.

This has been given on this group before, so I won't go into detail. You can
also find it in my book "The XML & SGML Cookbook" under "Type Extension".

==========================================================
The XML & SGML Cookbook, by Rick Jelliffe
Charles F. Goldfarb Series on Open Information Management
656 pages + CD-ROM, Prentice Hall 1998, ISBN 0-13-614223-0
http://www.sil.org/sgml/jelliffeXMLAnn.html
http://www.phptr.com/  > Book Search > "Jelliffe"
http://www.amazon.com/exec/obidos/ASIN/0136142230/002-4102466-3352420


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.