source: icXML/icXML-devel/src/xercesc/dom/DOMXPathExpression.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 5.3 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: DOMXPathExpression.hpp 698579 2008-09-24 14:13:08Z borisk $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSION_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMXPATHEXPRESSION_HPP
24
25#include <xercesc/util/XercesDefs.hpp>
26#include <xercesc/dom/DOMXPathResult.hpp>
27
28XERCES_CPP_NAMESPACE_BEGIN
29
30class DOMNode;
31
32/**
33 * The <code>DOMXPathExpression</code> interface represents a parsed and resolved XPath expression.
34 * @since DOM Level 3
35 */
36class CDOM_EXPORT DOMXPathExpression
37{
38
39protected:
40    // -----------------------------------------------------------------------
41    //  Hidden constructors
42    // -----------------------------------------------------------------------
43    /** @name Hidden constructors */
44    //@{
45    DOMXPathExpression() {};
46    //@}
47
48private:
49    // -----------------------------------------------------------------------
50    // Unimplemented constructors and operators
51    // -----------------------------------------------------------------------
52    /** @name Unimplemented constructors and operators */
53    //@{
54    DOMXPathExpression(const DOMXPathExpression &);
55    DOMXPathExpression& operator = (const  DOMXPathExpression&);
56    //@}
57
58public:
59    // -----------------------------------------------------------------------
60    //  All constructors are hidden, just the destructor is available
61    // -----------------------------------------------------------------------
62    /** @name Destructor */
63    //@{
64    /**
65     * Destructor
66     *
67     */
68    virtual ~DOMXPathExpression() {};
69    //@}
70
71    // -----------------------------------------------------------------------
72    // Virtual DOMXPathExpression interface
73    // -----------------------------------------------------------------------
74    /** @name Functions introduced in DOM Level 3 */
75    //@{
76
77    /**
78     * Evaluates this XPath expression and returns a result.
79     * @param contextNode of type <code>DOMNode</code> The context is context
80     * node for the evaluation of this XPath expression.
81     * If the XPathEvaluator was obtained by casting the Document then this must
82     * be owned by the same document and must be a <code>DOMDocument</code>, <code>DOMElement</code>,
83     * <code>DOMAttribute</code>, <code>DOMText</code>, <code>DOMCDATASection</code>,
84     * <code>DOMComment</code>, <code>DOMProcessingInstruction</code>, or
85     * <code>XPathNamespace</code>. If the context node is a <code>DOMText</code> or a
86     * <code>DOMCDATASection</code>, then the context is interpreted as the whole logical
87     * text node as seen by XPath, unless the node is empty in which case it may not
88     * serve as the XPath context.
89     * @param type If a specific type is specified, then the result
90     * will be coerced to return the specified type relying on XPath conversions and fail
91     * if the desired coercion is not possible. This must be one of the type codes of <code>DOMXPathResult</code>.
92     * @param result of type DOMXPathResult* The result specifies a specific result object which
93     * may be reused and returned by this method. If this is specified as nullor the
94     * implementation does not reuse the specified result, a new result object will be constructed
95     * and returned.
96     * @return DOMXPathResult* The result of the evaluation of the XPath expression.
97     * @exception <code>DOMXPathException</code>
98     * TYPE_ERR: Raised if the result cannot be converted to return the specified type.
99     * @exception <code>DOMException</code>
100     * WRONG_DOCUMENT_ERR: The <code>DOMNode</code> is from a document that is not supported by
101     * the <code>XPathEvaluator</code> that created this <code>DOMXPathExpression</code>.
102     * NOT_SUPPORTED_ERR: The DOMNode is not a type permitted as an XPath context node or the
103     * request type is not permitted by this <code>DOMXPathExpression</code>.
104     */
105
106    virtual DOMXPathResult* evaluate(const DOMNode *contextNode,
107                                     DOMXPathResult::ResultType type,
108                                     DOMXPathResult* result) const = 0;
109    //@}
110
111    // -----------------------------------------------------------------------
112    //  Non-standard Extension
113    // -----------------------------------------------------------------------
114    /** @name Non-standard Extension */
115    //@{
116    /**
117     * Called to indicate that this DOMXPathExpression is no longer in use
118     * and that the implementation may relinquish any resources associated with it.
119     *
120     * Access to a released object will lead to unexpected result.
121     */
122    virtual void release() = 0;
123    //@}
124
125};
126
127XERCES_CPP_NAMESPACE_END
128
129#endif
Note: See TracBrowser for help on using the repository browser.