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 =20
below).
The question I have is about restricting the use of generic elements in =20
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@allette.com.au
Sent: Thursday, October 09, 1997 4:10 PM
To: xml-dev@ic.ac.uk; Kirkpatrick, Alfie
Subject: Re: Inheritance/defaulting of attributes
--------------------------------------------------------------------------=
=20
--
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 )>
=20
which is not very satisfactory IMHO.
Rick Jelliffe