the function func() needs to be a reference to a JavaScript function that is
callable during evaluation (i.e., a non-standard function).
To implement this whilst still using a native DOM, the expression would
need to be cracked open and the separate parts evaluated individually. In
the example above we'd need to do the following:
Get the node referred to by "d" and then retrieve the value; let's say it's
'2'.
Call the JavaScript function with the value returned from step 1, i.e.,
func( 2 ). Let's say this function returns 6.
Insert the value returned from step 2 into the XPath expression and then
evaluate the XPath expression.
This needs to be generic, since functions can appear anywhere in an XPath
expression. For example:
func2(a/b[func(c/d)])
Note also that since XPath already comes with some built-in functions we
can't simply check for anything of the form "abc()" -- we'll have to check
for the extension functions by name.
Owner set to ----
Ticket status set to Accepted
Priority: Medium
Type: Enhancement
Added label: performance
Imported from backplanejs Google Code issue 53.
In the expression:
a/b[func(d)]
the function func() needs to be a reference to a JavaScript function that is callable during evaluation (i.e., a non-standard function).
To implement this whilst still using a native DOM, the expression would need to be cracked open and the separate parts evaluated individually. In the example above we'd need to do the following:
This needs to be generic, since functions can appear anywhere in an XPath expression. For example:
func2(a/b[func(c/d)])
Note also that since XPath already comes with some built-in functions we can't simply check for anything of the form "abc()" -- we'll have to check for the extension functions by name.
Owner set to ----
Ticket status set to Accepted
Priority: Medium Type: Enhancement Added label: performance