SourceForge.net Logo
Node.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2001, 2008,
3 * DecisionSoft Limited. All rights reserved.
4 * Copyright (c) 2004, 2015 Oracle and/or its affiliates. All rights reserved.
5 *
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19
20#ifndef _XQILLANODE_HPP
21#define _XQILLANODE_HPP
22
25#include <xqilla/ast/XQStep.hpp>
26
27class DynamicContext;
29class Sequence;
30class Result;
31class NodeTest;
32
33class XQILLA_API Node : public Item
34{
35public:
37
39 virtual bool isNode() const;
40
42 virtual bool isAtomicValue() const;
43
44 virtual bool isFunction() const;
45
46 virtual void typeToBuffer(DynamicContext *context, XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer &buffer) const;
47
49 virtual const XMLCh* asString(const DynamicContext* context) const = 0;
50
52 virtual bool hasInstanceOfType(const XMLCh* typeURI, const XMLCh* typeName, const DynamicContext* context) const = 0;
53
56 virtual Sequence dmBaseURI(const DynamicContext* context) const = 0;
57
59 virtual const XMLCh* dmNodeKind() const = 0;
60
62 virtual ATQNameOrDerived::Ptr dmNodeName(const DynamicContext* context) const = 0;
63
65 virtual const XMLCh* dmStringValue(const DynamicContext* context) const = 0;
66
70 virtual Sequence dmTypedValue(DynamicContext* context) const = 0;
71
74 virtual Sequence dmDocumentURI(const DynamicContext* context) const = 0;
75
77 virtual ATQNameOrDerived::Ptr dmTypeName(const DynamicContext* context) const = 0;
78
80 virtual ATBooleanOrDerived::Ptr dmNilled(const DynamicContext* context) const = 0;
81
84 virtual bool lessThan(const Node::Ptr &other, const DynamicContext *context) const = 0;
85
87 virtual bool equals(const Node::Ptr &other) const = 0;
88
91 virtual bool uniqueLessThan(const Node::Ptr &other, const DynamicContext *context) const = 0;
92
94 virtual Node::Ptr root(const DynamicContext* context) const = 0;
95
97 virtual Node::Ptr dmParent(const DynamicContext* context) const = 0;
98
100 virtual Result dmAttributes(const DynamicContext* context, const LocationInfo *info) const = 0;
101
103 virtual Result dmNamespaceNodes(const DynamicContext* context, const LocationInfo *info) const = 0;
104
106 virtual Result dmChildren(const DynamicContext *context, const LocationInfo *info) const = 0;
107
113 virtual Result getAxisResult(XQStep::Axis axis, const NodeTest *nodeTest, const DynamicContext *context, const LocationInfo *info) const = 0;
114
116 virtual ATBooleanOrDerived::Ptr dmIsId(const DynamicContext* context) const = 0;
117
119 virtual ATBooleanOrDerived::Ptr dmIsIdRefs(const DynamicContext* context) const = 0;
120
121 /* Get the namespace URI for the DOM type */
122 virtual const XMLCh* getTypeURI() const = 0;
123
124 /* Get the name of the DOM type (ie "integer" for xs:integer) */
125 virtual const XMLCh* getTypeName() const = 0;
126
127 static const XMLCh document_string[];
128 static const XMLCh element_string[];
129 static const XMLCh attribute_string[];
130 static const XMLCh text_string[];
131 static const XMLCh processing_instruction_string[];
132 static const XMLCh comment_string[];
133 static const XMLCh namespace_string[];
134};
135#endif
RefCountPointer< const ATBooleanOrDerived > Ptr
Definition ATBooleanOrDerived.hpp:53
RefCountPointer< const ATQNameOrDerived > Ptr
Definition ATQNameOrDerived.hpp:32
The execution time dynamic context interface.
Definition DynamicContext.hpp:39
Item()
Definition Item.hpp:67
A class that gives records a location in the query.
Definition LocationInfo.hpp:30
Definition Node.hpp:34
virtual ATBooleanOrDerived::Ptr dmIsIdRefs(const DynamicContext *context) const =0
Returns if the node is an idref node or not.
virtual void typeToBuffer(DynamicContext *context, xercesc::XMLBuffer &buffer) const
Debug method to output the type of the item in SequenceType notation.
virtual ATBooleanOrDerived::Ptr dmNilled(const DynamicContext *context) const =0
Accessor: returns the setting of the nilled property of an element node.
static const XMLCh comment_string[]
Definition Node.hpp:132
static const XMLCh namespace_string[]
Definition Node.hpp:133
virtual ATQNameOrDerived::Ptr dmNodeName(const DynamicContext *context) const =0
Accessor: returns the name of this node.
virtual const XMLCh * asString(const DynamicContext *context) const =0
Serialize this node.
virtual const XMLCh * dmNodeKind() const =0
Accessor: returns the kind of node as a string.
static const XMLCh text_string[]
Definition Node.hpp:130
virtual bool isFunction() const
virtual Result getAxisResult(XQStep::Axis axis, const NodeTest *nodeTest, const DynamicContext *context, const LocationInfo *info) const =0
Returns a Result containing the nodes in the axis given, relative to this node.
virtual Result dmAttributes(const DynamicContext *context, const LocationInfo *info) const =0
Returns the attributes of this node.
virtual const XMLCh * getTypeName() const =0
virtual Sequence dmDocumentURI(const DynamicContext *context) const =0
Accessor: returns the absolute URI of the resource from which the document node was constructed,...
virtual Result dmNamespaceNodes(const DynamicContext *context, const LocationInfo *info) const =0
Returns the namespace nodes of this node.
virtual Sequence dmBaseURI(const DynamicContext *context) const =0
Accessor: returns the base-uri of this node as a xs:anyURI, if one exists.
static const XMLCh attribute_string[]
Definition Node.hpp:129
virtual Node::Ptr root(const DynamicContext *context) const =0
Returns the root of this node.
virtual bool isNode() const
Returns true, since this Item is a Node.
virtual ATBooleanOrDerived::Ptr dmIsId(const DynamicContext *context) const =0
Returns if the node is an id node or not.
virtual bool lessThan(const Node::Ptr &other, const DynamicContext *context) const =0
Returns true if 'this' is before 'other' in document order, false otherwise.
RefCountPointer< const Node > Ptr
Definition Node.hpp:36
virtual ATQNameOrDerived::Ptr dmTypeName(const DynamicContext *context) const =0
Accessor: returns the name of the type of a node.
virtual bool equals(const Node::Ptr &other) const =0
Returns true if 'other' is equal (identity equal) to 'this'.
virtual Result dmChildren(const DynamicContext *context, const LocationInfo *info) const =0
Returns the children of this node.
virtual Node::Ptr dmParent(const DynamicContext *context) const =0
Returns the parent of this node.
virtual bool uniqueLessThan(const Node::Ptr &other, const DynamicContext *context) const =0
Specifies a sorting order for uniqueness removal.
virtual const XMLCh * dmStringValue(const DynamicContext *context) const =0
Accessor: returns the string value of this node.
static const XMLCh element_string[]
Definition Node.hpp:128
virtual Sequence dmTypedValue(DynamicContext *context) const =0
Accessor: returns the typed value of this node, which is a sequence of zero or more atomic values der...
static const XMLCh document_string[]
Definition Node.hpp:127
virtual const XMLCh * getTypeURI() const =0
virtual bool hasInstanceOfType(const XMLCh *typeURI, const XMLCh *typeName, const DynamicContext *context) const =0
check if the underlying type of this node is instance of a certain type
static const XMLCh processing_instruction_string[]
Definition Node.hpp:131
virtual bool isAtomicValue() const
Returns false, since this Item is a Node.
Super class of all the reference counted wrappers for Items.
Definition ReferenceCounted.hpp:62
A scoped pointer wrapper for the lazily evaluated query result.
Definition Result.hpp:38
An eagerly evaluated result of a query execution.
Definition Sequence.hpp:40
Definition XPath2MemoryManager.hpp:46