xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: Content Inheritance
Date Wed, 22 Dec 1999 22:27:38 GMT
On Wed, 22 Dec 1999, Clark C. Evans wrote:

> I looked most of the thread over, and it looks good.
> I used a similar mechanism for describing a CDROM 
> layout for Gartner Group, a nested tree with big 
> time repeating groups and specilization.  I called
> the construct a "matrix composite" and presented
> it as a design pattern 3-4 years ago.  This is a
> very interesting construct -- I was focusing on
> represeting N extremely similar trees using a
> single graph -- I was using labels in the nodes
> to parameterize what tree the given node applies
> to.  Anyway... you name is far better, but it
> gives rise to the following questions:
> 
> * node.parent() becomes meaningless in this context,
>   since it is now a full graph... or, you view
>   the entire spec as a pre-processing stage...

No, elements (except for the document root, of course) must have a
'physical' or 'positional' parent, but may also have one or more 'logical'
parents.

> * do you allow for multiple inheritance?  Or, 
>   would a delegation like mechanism be better?

If I have my way, we do. My proposal is, again:

<element>
 <ixml:extends name="parent_name" id="parent_id_value"/>
 <ixml:extends name="other_parent_name" id="other_parent_id_value"/>
</element>

> * do you allow for templates too?  (inhertance
>   parameterized by one or more attributes...)

Uh, maybe? I'm not sure what you mean. I had proposed two attribtes of
ixml:extends that parameterize the inheritance:

inherits-elements - if true, the logical child inherits a deep copy of the
logical parent's physical elemental children

inherits-attribute - if true, the logical child inherits the logical
parent's attributes (if the logical child doesn't already have said
attribute)

I'm just now finishing up a processor for cocoon that 'normalizes'
documents with <ixml:extends> elements. I'll be checking it into cocoon
shortly (probably in org.apache.cocoon.processor.ixml) so if you're
interested in playing around with this for real rather than in theory, you
should be able to do so shortly.

- donald


Mime
View raw message