DTD question - UML inheritance

Subject: DTD question - UML inheritance
From: "Terris" <terris@xxxxxxxxxx>
Date: Thu, 23 Sep 1999 14:17:46 -0700
Hi,

I realize this is the XSL list, but there are obviously
a lot of people on this list who have experience
with XML.

I have a DTD design question.  I want to represent
an object model that has inheritance.  How
do you think I should best represent instances
of a subclass?  Should I use containment or
should I hide the base class name?

Containment:

<BaseClass><SubClass/></BaseClass>

Hiding the BaseClass:

<Subclass/>

In the latter case, the <Subclass> would have all
of the <BaseClass's> attributes and elements.

>From an XSLT perspective, I think it would
be more difficult to search documents in a generic fashion if
the <BaseClass> is hidden.  By "generic"
I mean that I want to write
a stylesheet that only searches for properties in
the <BaseClass> regardless of which <SubClass>
is actually instantiated.  Without <BaseClass>
being in the document, I would have to use multiple XPATHs, each
containing the name of every possible SubClass.
The patterns would break if any new subclasses were
added.  This seems like a bad thing.

Thank you,
Terris



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread