xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max R. Andersen" <...@mail1.stofanet.dk>
Subject Re: Deferred nodes and a little bit of swing :)
Date Mon, 07 Feb 2000 22:14:53 GMT
Andy Clark wrote:
> 
> "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. :)

Give me a day or two - then it will be "presentable" :)

Should I just post it here as attachments ?

> > 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.
> 

That was also my understanding, but something is not working as I
want it :)

Small snippet of code from my short-lived memory:

<loading of a xml document with deferred node and external entities>

when I traverse the first level of children some of these are not
"expanded"

I test to see if they are deferred by doing the following:

if (asinglenode instanceof DeferredNode) {
	<code that should expand it>
}

Now I would think it would be enough to just ask this node for something
and
it would be fetched - but nope it doesn't work.

I have tried to call all the methods in the Node interface on
asinglenode, but they all return null or similar "non-existing" values.

regards
 Max

Mime
View raw message