Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.8

Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

FormatterListener.hpp

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2004 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 #if !defined(FORMATTERLISTENER_HEADER_GUARD_1357924680)
00017 #define FORMATTERLISTENER_HEADER_GUARD_1357924680
00018 
00029 // Base include file.  Must be first.
00030 #include <xalanc/PlatformSupport/PlatformSupportDefinitions.hpp>
00031 
00032 
00033 
00034 #include <xercesc/sax/DocumentHandler.hpp>
00035 
00036 
00037 
00038 #include <xalanc/XalanDOM/XalanDOMString.hpp>
00039 
00040 
00041 
00042 XALAN_CPP_NAMESPACE_BEGIN
00043 
00044 
00045 
00046 class PrefixResolver;
00047 class Writer;
00048 
00049 
00050 
00051 typedef XERCES_CPP_NAMESPACE_QUALIFIER Locator          LocatorType;
00052 typedef XERCES_CPP_NAMESPACE_QUALIFIER AttributeList    AttributeListType;
00053 
00054 
00055 
00060 class XALAN_PLATFORMSUPPORT_EXPORT FormatterListener : public XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler
00061 {
00062 public:
00063 
00064     typedef XERCES_CPP_NAMESPACE_QUALIFIER DocumentHandler  ParentType;
00065 
00066     // A handy typedef...  Must match DocumentHandler's type for characters(), etc...
00067     typedef unsigned int    size_type;
00068 
00069     enum eFormat
00070     {
00071         OUTPUT_METHOD_NONE = 0,
00072         OUTPUT_METHOD_XML = 1,
00073         OUTPUT_METHOD_HTML = 2,
00074         OUTPUT_METHOD_TEXT = 3,
00075         OUTPUT_METHOD_DOM = 4,
00076         OUTPUT_METHOD_OTHER = 5
00077     };
00078 
00079     FormatterListener(eFormat   theFormat);
00080 
00081     virtual
00082     ~FormatterListener();
00083 
00084 
00085     eFormat
00086     getOutputFormat() const
00087     {
00088         return m_outputFormat;
00089     }
00090 
00096     const PrefixResolver*
00097     getPrefixResolver() const
00098     {
00099         return m_prefixResolver;
00100     }
00101 
00107     void
00108     setPrefixResolver(const PrefixResolver*     thePrefixResolver)
00109     {
00110         m_prefixResolver = thePrefixResolver;
00111     }
00112 
00122     virtual void
00123     charactersRaw(
00124             const XMLCh* const  chars,
00125             const size_type     length) = 0;
00126 
00133     virtual void
00134     comment(const XMLCh* const  data) = 0;
00135 
00157     virtual void
00158     cdata(
00159             const XMLCh* const  ch,
00160             const size_type     length) = 0;
00161 
00168     virtual void
00169     entityReference(const XMLCh* const  name) = 0;
00170 
00171 
00172 // These methods are inherited from DocumentHandler ...
00173 
00174     virtual void
00175     characters(
00176             const XMLCh* const  chars,
00177             const size_type     length) = 0;
00178 
00179     virtual void
00180     endDocument() = 0;
00181 
00182     virtual void
00183     endElement(const XMLCh* const   name) = 0;
00184 
00185     virtual void
00186     ignorableWhitespace(
00187             const XMLCh* const  chars,
00188             const size_type     length) = 0;
00189 
00190     virtual void
00191     processingInstruction(
00192             const XMLCh* const  target,
00193             const XMLCh* const  data) = 0;
00194 
00195     virtual void
00196     resetDocument() = 0;
00197 
00198     virtual void
00199     setDocumentLocator(const LocatorType* const     locator) = 0;
00200 
00201     virtual void
00202     startDocument() = 0;
00203 
00204     virtual void
00205     startElement(
00206             const   XMLCh* const    name,
00207             AttributeListType&      attrs) = 0;
00208 
00209     virtual Writer*
00210     getWriter() const;
00211 
00212     virtual const XalanDOMString&
00213     getDoctypeSystem() const;
00214 
00215     virtual const XalanDOMString&
00216     getDoctypePublic() const;
00217 
00218     virtual const XalanDOMString&
00219     getEncoding() const;
00220 
00221     virtual const XalanDOMString&
00222     getMediaType() const;
00223 
00224     virtual int
00225     getIndent() const;
00226 
00227 
00228     // Used when creating PI to work around limitations of
00229     // our interfaces...
00230     static const XalanDOMChar   s_piTarget[];
00231 
00232     static const XalanDOMChar   s_piData[];
00233 
00234 #if defined(XALAN_INLINE_INITIALIZATION)
00235     static const XalanDOMString::size_type  s_piTargetLength = 5;
00236     static const XalanDOMString::size_type  s_piDataLength = 3;
00237 #else
00238     static const XalanDOMString::size_type  s_piTargetLength;
00239     static const XalanDOMString::size_type  s_piDataLength;
00240 #endif
00241 
00242 protected:
00243 
00244     // Data membmers...
00245     const PrefixResolver*   m_prefixResolver;
00246 
00247     static const XalanDOMString     s_emptyString;
00248 
00249 private:
00250 
00251     // Not implemented...
00252     FormatterListener(const FormatterListener&);
00253 
00254     FormatterListener&
00255     operator=(const FormatterListener&);
00256 
00257     bool
00258     operator==(const FormatterListener&) const;
00259 
00260     // Data membmers...
00261     const eFormat   m_outputFormat;
00262 };
00263 
00264 
00265 
00266 XALAN_CPP_NAMESPACE_END
00267 
00268 
00269 
00270 #endif  // FORMATTERLISTENER_HEADER_GUARD_1357924680

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.8
Copyright © 1999-2004 The Apache Software Foundation. All Rights Reserved.