From: Wolfgang M. <me...@if...> - 2003-07-01 08:08:58
|
Hi, I added your patches and fixed another problem concerning the wildcard handling: expressions like //A/*[. &= 'xx'] did not work with the latest version of VirtualNodeSet.java. The expression returned the wrong nodes (it should return children of A). > The problem result from addChildren in VirtualNodeSet. The for-loop uses > childCount as parameter but within the loop a node iterator is used. This > iterator however doesn't loop only accross the children but accross all > nodes under the context node in preorder traversal. So we get two nodes > but the first two nodes in preorder traversal, not the two children. > Furthermore if B would have an attribute only the node B would be returned > because the attribute would be the second node of the iterator. This is correct. However, the node iterator is (especially for descendant expressions like //*) faster than calling Node.getChildNodes(). Node.getChildNodes() uses index lookups while the node iterator just sequentially walks through the DOM file. I have thus changed the addChildren() method to fix the problem you described while still using the node iterator. Hope this works. Thanks and best regards, Wolfgang |