Xalan-C++ API Reference 1.12.0
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
56namespace XALAN_CPP_NAMESPACE {
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{
70public:
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 */
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 */
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 */
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
124 const XMLCh* const ch,
125 const unsigned int length);
126
127 virtual void
129
130 virtual void
131 setDocumentLocator(const Locator* const locator);
132
133 virtual void
135
136 virtual void
138
139 virtual void
141 const XMLCh* const name,
143
144 virtual void
145 endElement(const XMLCh* const name);
146
147 virtual void
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
164
167 {
168 return m_doc;
169 }
170
171 void
176
179 {
180 return m_docFrag;
181 }
182
183 void
188
191 {
192 return m_currentElem;
193 }
194
195 void
197 {
198 m_currentElem = theElement;
199 }
200
201private:
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
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(
226
227 void
228 addAttributes(
231
232
233 // Data members...
234 DOM_Document_Type m_doc;
235
236 DOM_DocumentFragmentType m_docFrag;
237
238 DOM_ElementType m_currentElem;
239
240 typedef XalanVector<DOM_ElementType> ElementStackType;
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}
254
255
256
257#endif // FORMATTERTODEPRECATEDXERCESDOM_HEADER_GUARD_1357924680
#define XALAN_CPP_NAMESPACE
Xalan-C++ namespace, including major and minor version.
#define XALAN_XERCESPARSERLIAISON_EXPORT
A SAX-based formatter interface for the XSL processor.
This class takes SAX events (in addition to some extra events that SAX doesn't handle yet) and adds t...
virtual void entityReference(const XMLCh *const name)
Receive notification of a entityReference.
FormatterToDeprecatedXercesDOM(DOM_Document_Type &doc, DOM_DocumentFragmentType &docFrag, DOM_ElementType &currentElement)
Construct a FormatterToDeprecatedXercesDOM instance.
virtual void processingInstruction(const XMLCh *const target, const XMLCh *const data)
virtual void setDocumentLocator(const Locator *const locator)
virtual void startElement(const XMLCh *const name, AttributeListType &attrs)
virtual void ignorableWhitespace(const XMLCh *const chars, const unsigned int length)
virtual void comment(const XMLCh *const data)
Called when a Comment is to be constructed.
virtual void cdata(const XMLCh *const ch, const unsigned int length)
FormatterToDeprecatedXercesDOM(DOM_Document_Type &doc)
Construct a FormatterToDeprecatedXercesDOM instance.
virtual void charactersRaw(const XMLCh *const chars, const unsigned int length)
virtual void characters(const XMLCh *const chars, const unsigned int length)
void setDocumentFragment(DOM_DocumentFragmentType &theDocumentFragment)
virtual void endElement(const XMLCh *const name)
FormatterToDeprecatedXercesDOM(DOM_Document_Type &doc, DOM_ElementType &currentElement)
Construct a FormatterToDeprecatedXerces DOM instance.
xercesc::DOM_Element DOM_ElementType
xercesc::DOM_Node DOM_NodeType
xercesc::AttributeList AttributeListType
XalanDOMString & append(XalanDOMString &theString, const XalanDOMString &theStringToAppend)
Concatenate two strings.
xercesc::DOM_Document DOM_Document_Type
xercesc::DOM_DocumentFragment DOM_DocumentFragmentType