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

RE: Inheritance/defaulting of attributes

  • From: akirkpatrick@i...
  • To: xml-dev@i...,ricko@a...
  • Date: Thu, 9 Oct 1997 17:34:12 +0000

inheritance typeof
Firstly, I thought Paul's little essay on subclassing and inheritance
in DTDs was fascinating.

Re the question below from Rick: as I understood Paul, if an element
inherited a content model, it could define a more restrictive model for
itself but still had to be valid according to the parent model (see   
below).

The question I have is about restricting the use of generic elements in   
the
instance. For example, suppose we have:

<!ELEMENT para (#PCDATA | inline | block)*>
<!ELEMENT inline (#PCDATA)>
<!ELEMENT block (para+)>

<!ELEMENT title TYPEOF para (#PCDATA | inline)*>

<!ELEMENT filename TYPEOF inline>
<!ELEMENT emphasis TYPEOF inline>
...

<!ELEMENT admon TYPEOF block (title?, para+)>
<!ELEMENT note TYPEOF admon>
<!ELEMENT tip TYPEOF admon>
..
(look familiar?)

How do we stop the authors actually using <inline> and <block> which
have little meaning as they are? Do we need a "pure virtual" syntax
which indicates that an element type cannot be instantiated in the
instance?

Either way, I like this idea a lot. Does the instance syntax proposal for
XML take any of this into account? If so, I might be converted, on the
assumption that this type of thing won't make it into the SGML revision.

Alfie.

 ----------
From:  ricko@a...
Sent:  Thursday, October 09, 1997 4:10 PM
To:  xml-dev@i...; Kirkpatrick, Alfie
Subject:  Re: Inheritance/defaulting of attributes

 --------------------------------------------------------------------------  
 --
Has anyone come up with a good solution for what order element
types can be in if you have inheritance?

<!ELEMENT cat  (head, whiskers, paw+, tail)>
<!ELEMENT kitty  (cry) INHERITS cat>

is all very well, but what is the resulting content model?
It sounds like people expect it to be (using the SGML "&"
connector, which is not in XML):

<!ELEMENT kitty (( head, whiskers, paw+, tail ) & cry )>
   

which is not very satisfactory IMHO.

Rick Jelliffe

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.