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-2008
5  * Oracle. All rights reserved.
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  * $Id$
20  */
21 
22 #ifndef _XQILLANODE_HPP
23 #define _XQILLANODE_HPP
24 
27 #include <xqilla/ast/XQStep.hpp>
28 
29 class DynamicContext;
31 class Sequence;
32 class Result;
33 class NodeTest;
34 
35 class XQILLA_API Node : public Item
36 {
37 public:
39 
41  virtual bool isNode() const;
42 
44  virtual bool isAtomicValue() const;
45 
46  virtual bool isFunction() const;
47 
48  virtual void typeToBuffer(DynamicContext *context, XERCES_CPP_NAMESPACE_QUALIFIER XMLBuffer &buffer) const;
49 
51  virtual const XMLCh* asString(const DynamicContext* context) const = 0;
52 
54  virtual bool hasInstanceOfType(const XMLCh* typeURI, const XMLCh* typeName, const DynamicContext* context) const = 0;
55 
58  virtual Sequence dmBaseURI(const DynamicContext* context) const = 0;
59 
61  virtual const XMLCh* dmNodeKind() const = 0;
62 
64  virtual ATQNameOrDerived::Ptr dmNodeName(const DynamicContext* context) const = 0;
65 
67  virtual const XMLCh* dmStringValue(const DynamicContext* context) const = 0;
68 
72  virtual Sequence dmTypedValue(DynamicContext* context) const = 0;
73 
76  virtual Sequence dmDocumentURI(const DynamicContext* context) const = 0;
77 
79  virtual ATQNameOrDerived::Ptr dmTypeName(const DynamicContext* context) const = 0;
80 
82  virtual ATBooleanOrDerived::Ptr dmNilled(const DynamicContext* context) const = 0;
83 
86  virtual bool lessThan(const Node::Ptr &other, const DynamicContext *context) const = 0;
87 
89  virtual bool equals(const Node::Ptr &other) const = 0;
90 
93  virtual bool uniqueLessThan(const Node::Ptr &other, const DynamicContext *context) const = 0;
94 
96  virtual Node::Ptr root(const DynamicContext* context) const = 0;
97 
99  virtual Node::Ptr dmParent(const DynamicContext* context) const = 0;
100 
102  virtual Result dmAttributes(const DynamicContext* context, const LocationInfo *info) const = 0;
103 
105  virtual Result dmNamespaceNodes(const DynamicContext* context, const LocationInfo *info) const = 0;
106 
108  virtual Result dmChildren(const DynamicContext *context, const LocationInfo *info) const = 0;
109 
115  virtual Result getAxisResult(XQStep::Axis axis, const NodeTest *nodeTest, const DynamicContext *context, const LocationInfo *info) const = 0;
116 
118  virtual ATBooleanOrDerived::Ptr dmIsId(const DynamicContext* context) const = 0;
119 
121  virtual ATBooleanOrDerived::Ptr dmIsIdRefs(const DynamicContext* context) const = 0;
122 
123  /* Get the namespace URI for the DOM type */
124  virtual const XMLCh* getTypeURI() const = 0;
125 
126  /* Get the name of the DOM type (ie "integer" for xs:integer) */
127  virtual const XMLCh* getTypeName() const = 0;
128 
129  static const XMLCh document_string[];
130  static const XMLCh element_string[];
131  static const XMLCh attribute_string[];
132  static const XMLCh text_string[];
133  static const XMLCh processing_instruction_string[];
134  static const XMLCh comment_string[];
135  static const XMLCh namespace_string[];
136 };
137 #endif
Definition: XPath2MemoryManager.hpp:47
virtual const XMLCh * getTypeName() const =0
virtual bool isAtomicValue() const =0
virtual bool isNode() const =0
Definition: Node.hpp:35
virtual bool isFunction() const =0
Super class of all the reference counted wrappers for Items.
Definition: ReferenceCounted.hpp:58
A scoped pointer wrapper for the lazily evaluated query result.
Definition: Result.hpp:39
Definition: Item.hpp:38
virtual void typeToBuffer(DynamicContext *context, xercesc::XMLBuffer &buffer) const =0
Debug method to output the type of the item in SequenceType notation.
The execution time dynamic context interface.
Definition: DynamicContext.hpp:39
A class that gives records a location in the query.
Definition: LocationInfo.hpp:31
virtual const XMLCh * getTypeURI() const =0
An eagerly evaluated result of a query execution.
Definition: Sequence.hpp:41
virtual const XMLCh * asString(const DynamicContext *context) const =0
RefCountPointer< const Node > Ptr
Definition: Node.hpp:38