various issues

Joe English jenglish at crl.com
Fri Apr 11 21:33:03 BST 1997


Peter at ursus.demon.co.uk (Peter Murray-Rust) wrote:
> For discussion assume that the declarations belong to MYDTD
> David Megginson writes:
> >
> >   <?ArcBase html?> <?ArcBase math?>
>
> So in C++ terms MYDTD has two base  classes, HTML and MATH.

It may be easier to understand architectural forms if you
_don't_ think of it in C++ terms...  The mechanism is more like,
in Java, declaring that a class (DTD) implements an interface
(architecture) than inheriting an implementation from a base
class.

Even this is not really accurate, since in SGML elements don't 
_do_ anything, they just _are_; it's up to the application to 
interpret them.  The architectural mapping simply tells applications
that know how to process the architectural forms ("meta"-DTD) 
how to interpret instances conforming to a document type ("real" DTD)
based on that architecture.


> >   <!ELEMENT para ...>
> >   <!ATTLIST para
> >     html      NAME    #FIXED "p">
>
> This means that PARA (in MYDTD) inherits properties from P (in HTML).  Does
> that mean it automatically inherits the content model and the attributes?

I'm not sure I understand the question.  If you're asking if
it's now possible to write:

	<PARA ALIGN=CENTER> ... </PARA>

(where the ALIGN attribute is defined in the HTML meta-DTD
but not in MYDTD), the answer is no.  However, when it's 
interpreted by an HTML-architecture-aware processor, any 
"P" attributes with a default or #FIXED value in the meta-DTD 
will be (considered to be) present.


> For example, the content model of P is
> 	(%text)*
> which expands to
> 	(#PCDATA | IMG | BR | EM)*  <!-- several missed out -->
> Can PARA assume these or does it have to map each of these (e.g. IMG) onto
> html:
> 	<!ELEMENT image ...>
> 	<!ATTLIST image
> 	  html    NAME #FIXED "img>

A "PARA" element can contain whatever is allowed by its content
model in MYDTD.  The only restriction is that when the children
of a PARA element are mapped to HTML, the result must conform
to "P"s content model in the meta-DTD.

> similarly does PARA have to explicity declare the same attributes as P in HTM
> L?

Only if it wants to use those attributes in the source document.


> >   <!ELEMENT sym ...>
> >   <!ATTLIST symbol
> >     html      NAME    #FIXED "sym"
> >     math      NAME    #FIXED "symbol">
> >
> This is - presumably - multiple inheritance in that SYMBOL inherits something
> from HTML.SYM and MATH.SYMBOL (though I'm not clear what).  How does the
> content of SYMBOL relate to either of its two base classes?

When an HTML-architecture processor encounters a SYMBOL element, 
it treats it like an HTML "SYM" element (which does
not exist AFAIK, so this would probably be an error).
When a MATH-architecture processor encounters a SYMBOL element 
(in a document conforming to MYDTD) it treats it like a
SYMBOL element (as defined in the MATH meta-DTD).



--Joe English

  jenglish at crl.com

xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo at ic.ac.uk the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (rzepa at ic.ac.uk)




More information about the Xml-dev mailing list