xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: XML Inheritance Extentions (first try)
Date Tue, 21 Dec 1999 19:29:52 GMT
On Mon, 20 Dec 1999, Ben Laurie wrote:

> Donald Ball wrote:
> > 
> > On Mon, 20 Dec 1999, Ben Laurie wrote:
> > 
> > > I kinda like the underlying idea, but ... I'm very dubious about the
> > > whole idea of overwriting according to position. It seems to me that
> > > this is going to be ambiguous and hard to maintain except in rather
> > > trivial cases.
> > >
> > > Also, a change to a parent document would often require changes to all
> > > children, which rather defeats the object.
> > 
> > Can you give a for example here? I fail to see how changing the parent
> > would require changing the children...
> Well, if its positional, and you change the position of something in the
> parent, doesn't that mean that all the children will then change the
> wrong thing?

Ah, yes, if it _is_ positional (e.g. I want to extend the 5th child in
this document) then your criticism is valid. My proposal, though, isn't
positional at all. It allows you to say, "I want to extend the element
named 'foo' whose id is 'bar' in this document." Indeed, I'd like this to
become even more generic, so you can say, "I want to extend the element in
this document which matches this XPath expression."

I'd thought we would have to wait for the latter (selection based on
XPath), but I understand that Xalan allows one to perform XPath queries on
arbitrary DOM objects, so I'll have to investigate that and see if it's in
fact possible today. If so, my proposal becomes that much simpler:

<parent name="foo"/>

<child other="bar">
 <ixml:extends select="//parent[@name='foo']"/>

turns into

<parent name="foo"/>
<child name="foo" other="bar"/>

- donald

View raw message