TXmlEngXPathEvaluator Class Reference

#include <xml/dom/xmlengxpathevaluator.h>

class TXmlEngXPathEvaluator

Detailed Description

Evaluates XPath expressions on a DOM tree.

See the XPath specfication here: http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/xpath.html

Constructor & Destructor Documentation

TXmlEngXPathEvaluator ( )

IMPORT_CTXmlEngXPathEvaluator()

Default constructor

Member Function Documentation

CreateExpressionL ( const TDesC8 &, const MXmlEngNamespaceResolver * )

IMPORT_C RXmlEngXPathExpressionCreateExpressionL(const TDesC8 &aExpression,
const MXmlEngNamespaceResolver *aResolver = NULL
)

Precompiles and stores an XPath expression, which is returned to caller.

Information on how to write XPath expressions can be found here:

See also: http://en.wikipedia.org/wiki/XPath

Parameters
aExpressionThe expression to create
aResolverNot supported in current API. Reserved for future use.
Return Value
The compiled XPath expression.
Leave Codes
KXmlEngErrXPathSyntaxError compiling expression
KErrNoMemoryMemory allocation error

EvaluateL ( const TDesC8 &, const TXmlEngNode, const MXmlEngNamespaceResolver * )

IMPORT_C RXmlEngXPathResultEvaluateL(const TDesC8 &aExpression,
const TXmlEngNodeaContextNode,
const MXmlEngNamespaceResolver *aResolver = NULL
)

Evaluates the XPath expression given as a parameter and returns the result.

Parameters
aExpressionThe expression to evaluate
aContextNodeThe node relative to which the expression is evaluated.
aResolverNot supported in current API. Reserved for future use.
Return Value
The result of the evaluation.
Leave Codes
KXmlEngErrXPathResultError evaluating expression
KXmlEngErrXPathSyntaxError compiling expression
KErrNoMemoryMemory allocation error

EvaluateWithDependenciesL ( const TDesC8 &, const TXmlEngNode, const MXmlEngNamespaceResolver *, RXmlEngNodeSet & )

IMPORT_C RXmlEngXPathResultEvaluateWithDependenciesL(const TDesC8 &aExpression,
const TXmlEngNodeaContextNode,
const MXmlEngNamespaceResolver *aResolver,
RXmlEngNodeSet &aDependents
)

Does the same thing as EvaluateL(), but also calculates the dependency list of the expression.

Parameters
aExpressionThe expression to evaluate
aContextNodeThe node relative to which the expression is evaluated.
aResolverNot supported in current API. Reserved for future use.
aDependentsAfter the method has returned, contains set of nodes that the expression is dependent on.
Return Value
The result of evaluation
Leave Codes
KXmlEngErrXPathResultError evaluating expression
KXmlEngErrXPathSyntaxError compiling expression
KErrNoMemoryMemory allocation error

InstanceMap ( )

IMPORT_C CXmlEngXFormsInstanceMap *InstanceMap()

Returns the registered instance map. Ownership is not transferred.

Return Value
A pointer to the instance map or NULL if not registered.

SetInstanceMap ( CXmlEngXFormsInstanceMap * )

IMPORT_C voidSetInstanceMap(CXmlEngXFormsInstanceMap *aInstanceTrees)

Registers the instance map to be used when evaluating form expressions. The map contains DOM Documents and their names. For example, when evaluating the expression "instance('a')" the evaluator looks up a document that has the name "a" from the map.

Parameters
aInstanceTreesThe instance map, ownership is not transferred.