P6R::p6IXpathVariables Interface Reference

This interface is implemented by the application making use of the p6xpathexpression component. More...

#include <p6xpathvariables.h>

Inherits P6R::p6ICom.

List of all members.

Public Member Functions

virtual P6R::P6INT32 addref ()=0
 This method increases the reference count of the component instance by one.
virtual P6R::P6ERR externFunction (P6WCHAR *pFuncName, P6UINT32 funcLength, P6XPATH_RESULT *pParams, P6UINT32 numParams, P6XPATH_VAR *pVarValue)=0
 Invoke a function defined in an external component (e.g., an XSLT function).
virtual P6R::P6ERR lookupVariable (P6WCHAR *pVarName, P6XPATH_VAR *pVarValue)=0
 Look up the value of a variable, which is of the form $name, in a registered component.
virtual P6R::P6ERR queryInterface (const P6R::IID &iid, P6R::P6VOID **ppIface)=0
 This method queries the component for a specific interface.
virtual P6R::P6INT32 release ()=0
 This method decrements a components reference count.

Detailed Description

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 82 of file p6xpathvariables.h.


The documentation for this interface was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
Copyright © 2004 - 2010 P6R Inc. - All Rights Reserved.