- From: Jonas Sicking <jonas@sicking.cc>
- Date: Mon, 24 Apr 2006 06:59:16 -0700
- To: Bjoern Hoehrmann <derhoermi@gmx.net>, Web APIs WG <public-webapi@w3.org>
> I personally think ElementTraversal should be replaced by a > .selectSingleNode() method that supports a small XPath subset, There is a gigantic difference in performance between selectSingleNode and firstElementChild. Just parsing alone will take longer time then just iterating the children and finding the first element. > .previousElementSibling -> .selectSingleNode('previous-sibling::*') This will probably not work, unless we create a very complex definition of how selectSingleNode works. Usually the result of an XPath evaluation is sorted in document order, so this would actually select .parentNode.firstElementChild. If we want to make that return the previousElementSibling we need to define exactly how sorting works in all cases, something i'm very reluctant to do, and something that might be hard for implementations builing on a generic XPath engine. / Jonas
Received on Monday, 24 April 2006 13:59:39 UTC