On Fri, May 03, 2002 at 11:47:14AM -0400, Joseph Kesselman/CAM/Lotus wrote:
>
> >Now, if I create a custom implementation of org.w3c.dom.Node that makes
> >the database queries when the Nodes are expanded, can I trust the XPath
> >API not to expand the nodes unless demanded by the XPath queries I am
> >using?
>
> I think the answer is "no".
>
> XSLT doesn't make any promises about the order in which the source document
> is accessed, nor when data is or isn't read from that document.
>
> Xalan _currently_ reads DOM nodes in document order, on an as-requested
> basis. That may change in the future.
But I am not really wondering about the _order_ but rather _if_ Xalan/XPath
descends into Nodes (walks the tree) for Nodes that should not be affected by a
specific query. For example, given a path like
/data/request/ssn
Will Xalan/XPath descend into the node
/data/eis
, that is iterate over the children of the eis-element? I guess that the
answer still is "no", right?
> My recommendation would be that you break this up into stages -- perform a
> preprocessing stage which causes your DOM to be expanded (or at least
> stable), _then_ run XSLT on the result.
Well I am using a solution similar to that. Or rather, I pose my XPath queries
on a proprietary Node implementation and make sure the XPaths are only executed
on the relevant elements. But it is a clumsy solution and I'd rather give a
DOM-tree to the XPath API directly.
/Christoffer Soop
>
>
--
Christoffer Soop <[EMAIL PROTECTED]>
+46 (0)730 74 68 15 / +46 (0)8 651 24 36