Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


XalanSourceTreeElement.hpp
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680)
19 #define XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680
20 
21 
22 
24 
25 
26 
30 
31 
32 
33 XALAN_CPP_NAMESPACE_BEGIN
34 
35 
36 
43 
44 
45 
47 {
48 public:
49 
50  /**
51  * Constructor.
52  *
53  * @param theTagName The tag name of the element
54  * @param theOwnerDocument The document that owns the instance
55  * @param theAttributes An array of pointers to the attribute instances for the element
56  * @param theAttributeCount The number of attributes.
57  * @param theParentNode The parent node, if any.
58  * @param thePreviousSibling The previous sibling, if any.
59  * @param theNextSibling The next sibling, if any.
60  * @param theIndex The document-order index of the node.
61  */
63  MemoryManager& theManager,
64  const XalanDOMString& theTagName,
65  XalanSourceTreeDocument* theOwnerDocument,
66  XalanNode* theParentNode = 0,
67  XalanNode* thePreviousSibling = 0,
68  XalanNode* theNextSibling = 0,
69  IndexType theIndex = 0);
70 
71  virtual
73 
74  MemoryManager&
76  {
77  return m_memoryManager;
78  }
79 
80  // These interfaces are inherited from XalanElement...
81 
82  virtual const XalanDOMString&
83  getNodeName() const;
84 
85  virtual const XalanDOMString&
86  getNodeValue() const;
87 
88  virtual NodeType
89  getNodeType() const;
90 
91  virtual XalanNode*
92  getParentNode() const;
93 
94  virtual const XalanNodeList*
95  getChildNodes() const;
96 
97  virtual XalanNode*
98  getFirstChild() const;
99 
100  virtual XalanNode*
101  getLastChild() const;
102 
103  virtual XalanNode*
104  getPreviousSibling() const;
105 
106  virtual XalanNode*
107  getNextSibling() const;
108 
109  virtual const XalanNamedNodeMap*
110  getAttributes() const = 0;
111 
112  virtual XalanDocument*
113  getOwnerDocument() const;
114 
115  virtual const XalanDOMString&
116  getNamespaceURI() const = 0;
117 
118  virtual const XalanDOMString&
119  getPrefix() const = 0;
120 
121  virtual const XalanDOMString&
122  getLocalName() const = 0;
123 
124  virtual bool
125  isIndexed() const;
126 
127  virtual IndexType
128  getIndex() const;
129 
130  virtual const XalanDOMString&
131  getTagName() const;
132 
133  // public interfaces not inherited from XalanElement...
134 
136  getDocument() const
137  {
138  return m_ownerDocument;
139  }
140 
141  void
143  {
144  m_parentNode = theParent;
145  }
146 
147  void
148  setParent(XalanSourceTreeDocumentFragment* theParent);
149 
150  void
151  setPreviousSibling(XalanSourceTreeComment* thePreviousSibling);
152 
153  void
154  setPreviousSibling(XalanSourceTreeElement* thePreviousSibling);
155 
156  void
157  setPreviousSibling(XalanSourceTreeProcessingInstruction* thePreviousSibling);
158 
159  void
160  setPreviousSibling(XalanSourceTreeText* thePreviousSibling);
161 
162  void
163  appendSiblingNode(XalanSourceTreeComment* theSibling);
164 
165  void
166  appendSiblingNode(XalanSourceTreeElement* theSibling);
167 
168  void
169  appendSiblingNode(XalanSourceTreeProcessingInstruction* theSibling);
170 
171  void
172  appendSiblingNode(XalanSourceTreeText* theSibling);
173 
174  void
175  appendChildNode(XalanSourceTreeComment* theChild);
176 
177  void
178  appendChildNode(XalanSourceTreeElement* theChild);
179 
180  void
181  appendChildNode(XalanSourceTreeProcessingInstruction* theChild);
182 
183  void
184  appendChildNode(XalanSourceTreeText* theChild);
185 
186  void
187  setIndex(IndexType theIndex)
188  {
189  m_index = theIndex;
190  }
191 
192  /**
193  * Removes all of the children. Since the owner document controls the
194  * lifetime of all nodes in the document, this just sets the first child
195  * to 0.
196  */
197  void
199  {
200  m_firstChild = 0;
201  }
202 
203 protected:
204 
205  /*
206  XalanSourceTreeElement(
207  MemoryManager& theManager,
208  const XalanSourceTreeElement& theSource,
209  bool deep = false);
210  */
212 
213  // Data members...
215 
216 private:
217 
218  // Not implemented...
220 
222  operator=(const XalanSourceTreeElement& theSource);
223 
224  bool
225  operator==(const XalanSourceTreeElement& theRHS) const;
226 
227 
228  // Data members...
229  MemoryManager& m_memoryManager;
230 
231  XalanSourceTreeDocument* m_ownerDocument;
232 
233  XalanNode* m_parentNode;
234 
235  XalanNode* m_previousSibling;
236 
237  XalanNode* m_nextSibling;
238 
239  XalanNode* m_firstChild;
240 
241  IndexType m_index;
242 };
243 
244 
245 
246 XALAN_CPP_NAMESPACE_END
247 
248 
249 
250 #endif // !defined(XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680)
void setIndex(IndexType theIndex)
virtual const XalanDOMString & getPrefix() const =0
Get the namespace prefix of this node, or null if it is unspecified.
MemoryManager & getMemoryManager()
virtual const XalanDOMString & getNamespaceURI() const =0
Get the namespace URI of this node, or null if it is unspecified.
virtual XalanNode * getParentNode() const =0
Gets the parent of this node.
virtual const XalanDOMString & getNodeValue() const =0
Gets the value of this node, depending on its type.
XalanSourceTreeDocument * getDocument() const
virtual XalanNode * getFirstChild() const =0
Gets the first child of this node.
virtual NodeType getNodeType() const =0
An enum value representing the type of the underlying object.
virtual const XalanDOMString & getTagName() const =0
The name of the element.
virtual XalanDocument * getOwnerDocument() const =0
Gets the Document object associated with this node.
virtual bool isIndexed() const =0
Determine if the document is node-order indexed.
virtual const XalanNamedNodeMap * getAttributes() const =0
Gets a NamedNodeMap containing the attributes of this node (if it is an Element) or null otherwise...
void setParent(XalanSourceTreeElement *theParent)
void clearChildren()
Removes all of the children.
virtual XalanNode * getNextSibling() const =0
Gets the node immediately following this node.
#define XALAN_XALANSOURCETREE_EXPORT
virtual const XalanNodeList * getChildNodes() const =0
Gets a NodeList that contains all children of this node.
virtual XalanNode * getPreviousSibling() const =0
Gets the node immediately preceding this node.
const XalanDOMString & m_tagName
virtual const XalanDOMString & getNodeName() const =0
Gets the name of this node, depending on its type.
bool operator==(const XalanElement &theRHS) const
virtual XalanNode * getLastChild() const =0
Gets the last child of this node.
virtual const XalanDOMString & getLocalName() const =0
Returns the local part of the qualified name of this node.
virtual IndexType getIndex() const =0
Get the node's index.
XalanElement & operator=(const XalanElement &theSource)
unsigned long IndexType
Definition: XalanNode.hpp:64
static const XalanDOMString s_emptyString

Interpreting class diagrams

Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.

Xalan-C++ XSLT Processor Version 1.11
Copyright © 1999-2012 The Apache Software Foundation.
All Rights Reserved.

Apache Logo