xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Clark <an...@apache.org>
Subject Re: Deferred nodes and a little bit of swing :)
Date Mon, 07 Feb 2000 19:43:37 GMT
"Max R. Andersen" wrote:
> I have created a "slicker" implementation of the TreeModel used 
> in the swing examples for Xerces.

We'd be interested in seeing the code. :)

> What does this mean exactly ?
> What is the minimum "traversal" neede to expand a node, and what 
> is the code for it ?

The deferred expansion of the DOM document is transparent to a
program written using the W3C APIs. But in short, this is how 
it works...

1) Both structure and data are lazy evaluated for expansion.
2) When a child is queried at a node, all of its immediate
   children are created and "patched" together.
3) When the data is queried at a node, then the strings and
   such are created.

I would imagine that you don't have to do anything special
for your slicker TreeModel implementation. Until the user
"opens" each node level, the underlying DOM nodes are never
queried and therefore are never created.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org

Mime
View raw message