#include <p6xpathvariables.h>
Inherits P6R::p6ICom.
Public Member Functions | |
virtual P6INT32 | addref (void)=0 |
virtual P6R::P6ERR | externFunction (P6WCHAR *pFuncName, P6UINT32 funcLength, P6XPATH_RESULT *pParams, P6UINT32 numParams, P6XPATH_VAR *pVarValue)=0 |
virtual P6R::P6ERR | lookupVariable (P6WCHAR *pVarName, P6XPATH_VAR *pVarValue)=0 |
virtual P6R::P6ERR | queryInterface (const P6R::P6IID &iid, P6VOID **ppIface)=0 |
virtual P6INT32 | release (void)=0 |
This interface is implemented by the application making use of the p6xpathexpression component.
XPath expressions can contain XSLT variables (e.g., $amount). This interface is implemented by an application to provide values to these defined variables. An implementation of this interface is registered with an XSLT evaluation context and is called whenever a variable is found that is not defined in an XSLT template.
While this interface was designed to be used with an XSLT processor it can be used with any application that can return an P6R::p6IXMLNode for a variable of the form "$name". P6R::p6IRuleEngine component allows an instance of this interface to be registered.
As an example, the value of the XSLT varialbes '$price' in the XPath expression evaluation, <xsl:if test="$price = 5">, is obtained by calling P6R::p6IXPathVariables::lookupVaraible() with pVarName = '$price'.
Also note that XPath allows the implementation of user defined functions via the externFunction() method. When evaluating an XPath expression, if a function is detected that is not a known XPath function, then the evaluator will call the externFunction() method. This allows an application to create any set of extension functions with an implementation of this interface.
Thus the power of the XPath expression language is easily extended by defining (1) external variables that can get their values from any source (e.g., a TCP socket, a configuration file) and can change by an external means, and (2) with functions not already defined in XPath.
Definition at line 90 of file p6xpathvariables.h.