Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.10

FormatterListener.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #if !defined(FORMATTERLISTENER_HEADER_GUARD_1357924680)
17 #define FORMATTERLISTENER_HEADER_GUARD_1357924680
18 
29 // Base include file. Must be first.
31 
32 
33 
34 #include <xercesc/sax/DocumentHandler.hpp>
35 
36 
37 
39 
40 
41 
42 XALAN_CPP_NAMESPACE_BEGIN
43 
44 
45 
46 class PrefixResolver;
47 class Writer;
48 
49 
50 
51 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator LocatorType;
52 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList AttributeListType;
53 
54 XALAN_USING_XERCES(Locator)
55 XALAN_USING_XERCES(AttributeList)
56 
57 
62 class XALAN_PLATFORMSUPPORT_EXPORT FormatterListener : public XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler
63 {
64 public:
65 
66  typedef XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler ParentType;
67 
68  // A handy typedef... Must match DocumentHandler's type for characters(), etc...
69  typedef unsigned int size_type;
70 
71  enum eFormat
72  {
73  OUTPUT_METHOD_NONE = 0,
74  OUTPUT_METHOD_XML = 1,
75  OUTPUT_METHOD_HTML = 2,
76  OUTPUT_METHOD_TEXT = 3,
77  OUTPUT_METHOD_DOM = 4,
78  OUTPUT_METHOD_OTHER = 5
79  };
80 
82  {
83  XML_VERSION_1_0 = 0,
84  XML_VERSION_1_1 = 1
85  };
86 
87  FormatterListener(eFormat theFormat);
88 
89  virtual
91 
97  eFormat
99  {
100  return m_outputFormat;
101  }
102 
109  eXMLVersion
111  {
112  return m_XMLVersion;
113  }
114 
120  bool
122  {
123  return ( XML_VERSION_1_1 == m_XMLVersion );
124  }
125 
131  const PrefixResolver*
133  {
134  return m_prefixResolver;
135  }
136 
142  void
143  setPrefixResolver(const PrefixResolver* thePrefixResolver)
144  {
145  m_prefixResolver = thePrefixResolver;
146  }
147 
157  virtual void
158  charactersRaw(
159  const XMLCh* const chars,
160  const size_type length) = 0;
161 
168  virtual void
169  comment(const XMLCh* const data) = 0;
170 
192  virtual void
193  cdata(
194  const XMLCh* const ch,
195  const size_type length) = 0;
196 
203  virtual void
204  entityReference(const XMLCh* const name) = 0;
205 
206 
207 // These methods are inherited from DocumentHandler ...
208 
209  virtual void
210  characters(
211  const XMLCh* const chars,
212  const size_type length) = 0;
213 
214  virtual void
215  endDocument() = 0;
216 
217  virtual void
218  endElement(const XMLCh* const name) = 0;
219 
220  virtual void
221  ignorableWhitespace(
222  const XMLCh* const chars,
223  const size_type length) = 0;
224 
225  virtual void
226  processingInstruction(
227  const XMLCh* const target,
228  const XMLCh* const data) = 0;
229 
230  virtual void
231  resetDocument() = 0;
232 
233  virtual void
234  setDocumentLocator(const Locator* const locator) = 0;
235 
236  virtual void
237  startDocument() = 0;
238 
239  virtual void
240  startElement(
241  const XMLCh* const name,
242  AttributeList& attrs) = 0;
243 
244  virtual Writer*
245  getWriter() const;
246 
247  virtual const XalanDOMString&
248  getDoctypeSystem() const;
249 
250  virtual const XalanDOMString&
251  getDoctypePublic() const;
252 
253  virtual const XalanDOMString&
254  getEncoding() const;
255 
256  virtual const XalanDOMString&
257  getMediaType() const;
258 
259  virtual int
260  getIndent() const;
261 
262 
263  // Used when creating PI to work around limitations of
264  // our interfaces...
265  static const XalanDOMChar s_piTarget[];
266 
267  static const XalanDOMChar s_piData[];
268 
269 #if defined(XALAN_INLINE_INITIALIZATION)
270  static const XalanDOMString::size_type s_piTargetLength = 5;
271  static const XalanDOMString::size_type s_piDataLength = 3;
272 #else
275 #endif
276 
277 
278 protected:
279 
280  // Data membmers...
282 
284 
290  void
292  {
293  m_XMLVersion = theVersion;
294  }
295 
296 private:
297 
298  // Not implemented...
300 
302  operator=(const FormatterListener&);
303 
304  bool
305  operator==(const FormatterListener&) const;
306 
307  // Data membmers...
308  const eFormat m_outputFormat;
309 
310  eXMLVersion m_XMLVersion;
311 };
312 
313 
314 
315 XALAN_CPP_NAMESPACE_END
316 
317 
318 
319 #endif // FORMATTERLISTENER_HEADER_GUARD_1357924680

Interpreting class diagrams

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

dot

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

Apache Logo