- From: Scott Boag/CAM/Lotus <Scott_Boag@lotus.com>
- Date: Thu, 11 May 2000 16:50:17 -0400
- To: www-dom-xpath@w3.org
Philippe Le Hegaret <plh@w3.org> wrote: > Scott, for your next release, can you replace : > http://www.w3.org/StyleSheets/TR/W3C-WD > by > http://www.w3.org/StyleSheets/TR/base > , please ? Yep, done. Again, I apologize for the mis-step. > Given a specified node and a specified XPath expression (with a namespace > context), > find if the node matches the expression or not. > > I can already do this using the selectNodes method but it's not very efficient: > - select the list of nodes from the document element node with the specified > XPath expression. > - check if the specified node is in the list. > > Did I miss the function in the current proposal or am I the only one who would > like > to see this function ? Yes, you missed it. It's in the Expression object, in the "int match(Node context, XEnvironment environment)" method. I intentionally didn't add this to the Inquirer object, as it didn't seem part of the minimal interface. Personally, I would be just as glad to see it in the minimal interface also. I should note that the return values of match(...) probably needs some work... the return values are based on what you would want if you were an XSLT processor. I'm glad you would like to see this functionality, because it seemed as if most people didn't want it. Note that match expressions are not exactly the same as XPath expressions -- they are subsets of XPath. There are some things that don't make sense in match pattern expressions that are in XPath, though I forget what just at the moment. -scott
Received on Thursday, 11 May 2000 16:49:55 UTC