Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.11


FormatterToDeprecatedXercesDOM.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(FORMATTERTODEPRECATEDXERCESDOM_HEADER_GUARD_1357924680)
19 #define FORMATTERTODEPRECATEDXERCESDOM_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file. Must be first.
25 
26 
27 
29 
30 
31 
32 // Base class header file.
34 
35 
36 
38 
39 
40 
42 
43 // Required Xerces headers
44 
45 #if XERCES_VERSION_MAJOR >= 2
46 #include <xercesc/dom/deprecated/DOM_Document.hpp>
47 #include <xercesc/dom/deprecated/DOM_DocumentFragment.hpp>
48 #include <xercesc/dom/deprecated/DOM_Element.hpp>
49 #else
50 #include <xercesc/dom/DOM_Document.hpp>
51 #include <xercesc/dom/DOM_DocumentFragment.hpp>
52 #include <xercesc/dom/DOM_Element.hpp>
53 #endif
54 
55 
56 XALAN_CPP_NAMESPACE_BEGIN
57 
58 
59 
60 /**
61  * This class takes SAX events (in addition to some extra events that SAX
62  * doesn't handle yet) and adds the result to a document or document fragment.
63  *
64  * It is provided as assist developers transition away from the deprecated DOM.
65  *
66  * @deprecated The Xerces DOM bridge is deprecated.
67  */
69 {
70 public:
71 
72  /**
73  * Construct a FormatterToDeprecatedXercesDOM instance. it will add the DOM nodes
74  * to the document fragment.
75  *
76  * @deprecated This API is deprecated and is only provided as a transition tool
77  * @param doc document for nodes
78  * @param docFrag document fragment for nodes
79  * @param currentElement current element for nodes
80  */
82  DOM_Document_Type &doc,
83  DOM_DocumentFragmentType &docFrag,
84  DOM_ElementType &currentElement);
85 
86  /**
87  * Construct a FormatterToDeprecatedXerces DOM instance. it will add the DOM nodes
88  * to the document.
89  *
90  * @deprecated This API is deprecated and is only provided as a transition tool
91  * @param doc document for nodes
92  * @param elem current element for nodes
93  */
95  DOM_Document_Type &doc,
96  DOM_ElementType &currentElement);
97 
98  /**
99  * Construct a FormatterToDeprecatedXercesDOM instance. it will add the DOM nodes
100  * to the document.
101  *
102  * @deprecated This API is deprecated and is only provided as a transition tool
103  * @param doc document for nodes
104  */
106  DOM_Document_Type &doc);
107 
108  virtual
110 
111 
112  // These methods are inherited from DocumentHandler ...
113 
114  virtual void
116  const XMLCh* const chars,
117  const unsigned int length);
118 
119  virtual void
120  comment(const XMLCh* const data);
121 
122  virtual void
123  cdata(
124  const XMLCh* const ch,
125  const unsigned int length);
126 
127  virtual void
128  entityReference(const XMLCh* const name);
129 
130  virtual void
131  setDocumentLocator(const Locator* const locator);
132 
133  virtual void
134  startDocument();
135 
136  virtual void
137  endDocument();
138 
139  virtual void
140  startElement(
141  const XMLCh* const name,
142  AttributeListType& attrs);
143 
144  virtual void
145  endElement(const XMLCh* const name);
146 
147  virtual void
148  characters(
149  const XMLCh* const chars,
150  const unsigned int length);
151 
152  virtual void
154  const XMLCh* const chars,
155  const unsigned int length);
156 
157  virtual void
159  const XMLCh* const target,
160  const XMLCh* const data);
161 
162  virtual void
163  resetDocument();
164 
166  getDocument() const
167  {
168  return m_doc;
169  }
170 
171  void
173  {
174  m_doc = theDocument;
175  }
176 
179  {
180  return m_docFrag;
181  }
182 
183  void
185  {
186  m_docFrag = theDocumentFragment;
187  }
188 
191  {
192  return m_currentElem;
193  }
194 
195  void
197  {
198  m_currentElem = theElement;
199  }
200 
201 private:
202 
203  /**
204  * Process any accumulated text and create a node for it.
205  */
206  void
207  processAccumulatedText();
208 
209  /**
210  * Append a node to the current container.
211  */
212  void
213  append(DOM_NodeType &newNode);
214 
215  /**
216  * Create the appropriate element, complete with attributes set.
217  *
218  * @param theElementName The name for the new element
219  * @param attrs The SAX AttributeList for the new attributes.
220  * @return A pointer to the new instance.
221  */
223  createElement(
224  const XalanDOMChar* theElementName,
225  AttributeListType& attrs);
226 
227  void
228  addAttributes(
229  DOM_ElementType &theElement,
230  AttributeListType& attrs);
231 
232 
233  // Data members...
234  DOM_Document_Type m_doc;
235 
236  DOM_DocumentFragmentType m_docFrag;
237 
238  DOM_ElementType m_currentElem;
239 
241 
242  ElementStackType m_elemStack;
243 
244  XalanDOMString m_buffer;
245 
246  XalanDOMString m_textBuffer;
247 
248  static const XalanDOMString s_emptyString;
249 };
250 
251 
252 
253 XALAN_CPP_NAMESPACE_END
254 
255 
256 
257 #endif // FORMATTERTODEPRECATEDXERCESDOM_HEADER_GUARD_1357924680
static const XalanDOMString s_emptyString
virtual void startDocument()=0
virtual void setDocumentLocator(const Locator *const locator)=0
void setDocumentFragment(DOM_DocumentFragmentType &theDocumentFragment)
virtual void startElement(const XMLCh *const name, AttributeList &attrs)=0
#define XALAN_XERCESPARSERLIAISON_EXPORT
virtual void ignorableWhitespace(const XMLCh *const chars, const size_type length)=0
XERCES_CPP_NAMESPACE_QUALIFIER DOM_DocumentFragment DOM_DocumentFragmentType
void setCurrentElement(DOM_ElementType &theElement)
XalanDOMString & append(XalanDOMString &theString, const XalanDOMString &theStringToAppend)
Concatenate two strings.
virtual void resetDocument()=0
virtual void charactersRaw(const XMLCh *const chars, const size_type length)=0
Receive notification of character data.
virtual void characters(const XMLCh *const chars, const size_type length)=0
A SAX-based formatter interface for the XSL processor.
virtual void endDocument()=0
XERCES_CPP_NAMESPACE_QUALIFIER DOM_Document DOM_Document_Type
This class takes SAX events (in addition to some extra events that SAX doesn&#39;t handle yet) and adds t...
virtual void entityReference(const XMLCh *const name)=0
Receive notification of a entityReference.
virtual void cdata(const XMLCh *const ch, const size_type length)=0
Receive notification of cdata.
DOM_DocumentFragmentType getDocumentFragment() const
virtual void endElement(const XMLCh *const name)=0
XERCES_CPP_NAMESPACE_QUALIFIER DOM_Element DOM_ElementType
XalanDOMString::size_type length(const XalanDOMString &theString)
Get the length of a XalanDOMString.
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)=0
void setDocument(DOM_Document_Type &theDocument)
XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType
virtual void comment(const XMLCh *const data)=0
Called when a Comment is to be constructed.
XERCES_CPP_NAMESPACE_QUALIFIER DOM_Node DOM_NodeType

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