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 Mon, 20 Dec 1999 05:41:55 GMT
My proposed syntax differs somewhat from Stefano's. For the purposes of
this document, I'll choose, uh, 'ixml' for its namespace:

<connection id="normal" driver="org.gjt.mm.mysql.Driver"
            dburl="jdbc:mysql://mysql.example.com/test"/>

<querydefs name="options" doc-element="options" row-element="option"
           tag-case="lower">
 <column name="creation_date" format="MMMM d, yyyy"/>
</querydefs>

<query>
 <ixml:extends name="connection" id="normal"/>
 <ixml:extends name="querydefs" id="options" id-element="name"
               inherits-elements="true"/>
 select * from foo_table
</query>

would generate:

<query driver="org.gjt.mm.mysql.Driver" 
       dburl="jdbc:mysql://mysql.example.com/test"
       doc-element="options" row-element="option" tag-case="lower">
 <column name="creation_date" format="MMMM d, yyyy"/>
 select * from foo_table
</query>

The attributes allowed on the ixml:extends element would initially be:

href - to identify the location of an external XML document from which the
logical parent would be culled (default: this document)
name - the name of the logical parent element
id - the value of the logical parent's id attribute
id-attribute - the name of the logical parent's id attribute (default: id)
inherits-attributes - true/false, inherit attributes from logical parent
(default: true)
inherits-elements - true/false, inherit elements from logical parent
(default: false)

I'd think that eventually we should prefer use of an xpath attribute over
the name/id/id-attribute triplet, whose value would be an xpath
expression which should result in a single node. 

Going even further, I'm of the opinion that all XML nodes should be
addressible by a URL that combines protocol, sitename, document name, and
node selection expression (xpath, xql, whatever) in a standard way (e.g.
http://example.com/document.xml?xpath=//connection[name='standard']) and
if that ever came about, we could drop all location attributes except for
href, but no one else seems to be excited by this idea :P).

(Going even further into the realm of absurdity, I still think it would be
really neato if all XML nodes existed in a global namespace, e.g. my stuff
would live in 

<com>
 <webslingerZ>
  <balld>
   ...
  </balld>
 </webslingerZ>
</com>

sort of like AFS does it with files. Then we wouldn't have to worry about
site names and mapping url paths to filesystem paths and stuff like that.
But I digress mightily, my apologies).

Anyway, tangents aside, my proposal allows for polymorphism, independent
inheritance of attributes and elements (and possibly text nodes), and a
more finely controlled logical parent element selection.

- donald


Mime
View raw message