1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // XPath expression declaration
24 #ifndef XMLENGXPATHEXPRESSION_H
25 #define XMLENGXPATHEXPRESSION_H
27 #include <xml/dom/xmlengxpathresult.h>
28 #include <xml/dom/xmlengnamespaceresolver.h>
33 A compiled XPath expression is a textual expression transformed after
34 syntactical analysis into some internal representation of the expression. The
35 only missing element for evaluation of the expression is evaluation context:
36 the context node (where to start) and an optional set of prefix-to-namespace bindings.
38 XPath Expressions are created and instantiated by the Evaluator:
39 @see TXmlEngXPathEvaluator
41 See the XPath spec here:
42 http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/xpath.html
44 class RXmlEngXPathExpression
46 friend class TXmlEngXPathEvaluator;
49 /** XPath expression parts */
50 enum TXmlEngXPathExpressionPartType
57 /** Default constructor */
58 IMPORT_C RXmlEngXPathExpression();
60 /** Resets the compiled expression and frees the allocated memory */
61 IMPORT_C void Destroy();
63 /** Resets the compiled expression and frees the allocated memory */
69 Evaluates this expression.
71 @param aContextNode The node relative to which the expression is evaluated.
72 @param aResolver Not supported in current API. Reserved for future use.
73 @return Result of evaluation
74 @leave KXmlEngErrXPathResult Error evaluating expression
75 @leave KXmlEngErrXPathSyntax Error compiling expression
76 @leave KErrNoMemory Memory allocation error
77 @leave - Otherwise, any of the system wide errors.
79 IMPORT_C RXmlEngXPathResult EvaluateL(TXmlEngNode aContextNode,
80 const MXmlEngNamespaceResolver* aResolver = NULL) const;
83 // Extensions to XPath 1.0
86 Does the same thing as EvaluateL(), but also calculates the dependency list
89 @param aContextNode The node relative to which the expression is evaluated.
90 @param aDependents After the method has returned, contains set of nodes that
91 the expression is dependent on.
92 @param aResolver Not supported in current API. Reserved for future use.
93 @return Result of evaluation
94 @leave KXmlEngErrXPathResult Error evaluating expression
95 @leave KXmlEngErrXPathSyntax Error compiling expression
96 @leave KErrNoMemory Memory allocation error
97 @leave - Otherwise, any of the system wide errors.
99 IMPORT_C RXmlEngXPathResult EvaluateWithDependenciesL(TXmlEngNode aContextNode,
100 RXmlEngNodeSet& aDependents,
101 const MXmlEngNamespaceResolver* aResolver = NULL) const;
104 Set context data for the expression currently being evaluated.
106 Extended Context is data set by API users and available for XPath extension
107 functions. For more information:
108 @see RXmlEngXPathExpression
110 @param aContext Extended context pointer
112 IMPORT_C void SetExtendedContext(void* aContext);
115 Gets extended context data for the expression currently being evaluated.
117 @return Extended context pointer or NULL if not sete
119 @see SetExtendedContext
121 IMPORT_C void* ExtendedContext() const;
124 RXmlEngXPathExpression(void* aData, void* aData2);
133 #include <xml/dom/xmlengxpathexpression.inl>
135 #endif /* XMLENGXPATHEXPRESSION_H */