[XML-SIG] DOM Extension Proposal

Uche Ogbuji uogbuji@fourthought.com
Sun, 25 Jun 2000 09:31:02 -0600


Lars Marius Garshol wrote:

> > I have been wondering why we even have Attribute nodes in the DOM tree
> > at all. They are mainly useful for representing entity references in
> > attribute values, something that is very rarely useful. :-)

Paul Prescod:

> Attributes can also be independently addressed as objects in XPath,
> XSLT, Schematron, etc.

For non-XPath purposes, we're planning to put in this optimization because 
lazy instanciation would cover cases where nodes are needed.

For most XPath purposes, this optimization is useless, since we keep a node 
document-order index that speeds selection up several times, but requires that 
every node, including attributes, be evaluated.  So, for 4XPath, we're 
planning to go even further: provide a small, read-only DOM with _many_ 
optimizations and an a special doc-order index that checks element/attribute 
value rather than attribute node ID (this is not an option for a read/write 
DOM).  If you pass 4XPath an XML string, it will generate this "domlette", as 
we're calling it.  If you pass 4XPath a straight DOM, it works as now, and you 
miss out on the performance benefits of domlette, but at least the legacy is 
intact.

Does anyone have any comments on this?  We're about to begin work on it.

-- 
Uche Ogbuji                               Principal Consultant
uche.ogbuji@fourthought.com               +01 303 583 9900 x 101
Fourthought, Inc.                         http://Fourthought.com 
4735 East Walnut St, Ste. C, Boulder, CO 80301-2537, USA
Software-engineering, knowledge-management, XML, CORBA, Linux, Python