>If I call selectSingleNode on a given root, with a expression such as
>"[EMAIL PROTECTED]", what actual nodes does Xalan search?

Assuimng the document's already loaded into a DTM (more on that in a
moment): If the attribute called id is _declared_ as being an ID, I believe
we go with a straight table-lookup. If not, I believe Xalan will scan the
immediate children (since that's what you asked for) for elements with the
name "object", looking for one which has that attribute/value pair.


However: Please note that Xalan's internal model is DTM, not DOM. If you
pass in a DOM, we wrap a DTM API around it -- and that's currently done via
a preorder depth-first scan through the DOM tree, performed incrementally
as nodes are called for. So at that level, we _will_ wind up accessing all
the content of each child as we move past it.

Improving DOM2DTM's efficiency is a known item on our wishlist. What we
really need is a reliable way to map a node's object identity to a DTM
nodeHandle integer, and the standard DOM Level 2 APIs don't really give us
an efficient solution. We can probably do better when we know we're reading
from a Xerces DOM, and _may_ be able to improve matters for other DOMs when
DOM Level 3 becomes official. (The old Node Key proposal was more useful
for this specific task than the userData proposal which replaced it, though
the latter might do the job.)


Reply via email to