-
Notifications
You must be signed in to change notification settings - Fork 3
AddingXpathFunctions
mark.birbeck@webBackplane.com edited this page Jan 16, 2010
·
2 revisions
- summary How to add an XPath function
- labels Module-XForms,Type-HowTo
XForms relies heavily on XPath for providing different processing functionality. Adding new functions to the library is achieved by 'registering' the function with the XForms processor.
The registration function to use is , and the parameter to pass is an object:
To add an extension function that just adds two numbers together, we only need to provide an object with one property; the name of the property will be used as the name of the XPath function, and the value of the property will be the function itself:
Once registered, the function can be used within any XPath expression. For example:
or: