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 eFormat 00085 getOutputFormat() const 00086 { 00087 return m_outputFormat; 00088 } 00089 00095 const PrefixResolver* 00096 getPrefixResolver() const 00097 { 00098 return m_prefixResolver; 00099 } 00100 00106 void 00107 setPrefixResolver(const PrefixResolver* thePrefixResolver) 00108 { 00109 m_prefixResolver = thePrefixResolver; 00110 } 00111 00121 virtual void 00122 charactersRaw( 00123 const XMLCh* const chars, 00124 const size_type length) = 0; 00125 00132 virtual void 00133 comment(const XMLCh* const data) = 0; 00134 00156 virtual void 00157 cdata( 00158 const XMLCh* const ch, 00159 const size_type length) = 0; 00160 00167 virtual void 00168 entityReference(const XMLCh* const name) = 0; 00169 00170 00171 // These methods are inherited from DocumentHandler ... 00172 00173 virtual void 00174 characters( 00175 const XMLCh* const chars, 00176 const size_type length) = 0; 00177 00178 virtual void 00179 endDocument() = 0; 00180 00181 virtual void 00182 endElement(const XMLCh* const name) = 0; 00183 00184 virtual void 00185 ignorableWhitespace( 00186 const XMLCh* const chars, 00187 const size_type length) = 0; 00188 00189 virtual void 00190 processingInstruction( 00191 const XMLCh* const target, 00192 const XMLCh* const data) = 0; 00193 00194 virtual void 00195 resetDocument() = 0; 00196 00197 virtual void 00198 setDocumentLocator(const LocatorType* const locator) = 0; 00199 00200 virtual void 00201 startDocument() = 0; 00202 00203 virtual void 00204 startElement( 00205 const XMLCh* const name, 00206 AttributeListType& attrs) = 0; 00207 00208 virtual Writer* 00209 getWriter() const; 00210 00211 virtual const XalanDOMString& 00212 getDoctypeSystem() const; 00213 00214 virtual const XalanDOMString& 00215 getDoctypePublic() const; 00216 00217 virtual const XalanDOMString& 00218 getEncoding() const; 00219 00220 virtual const XalanDOMString& 00221 getMediaType() const; 00222 00223 virtual int 00224 getIndent() const; 00225 00226 00227 // Used when creating PI to work around limitations of 00228 // our interfaces... 00229 static const XalanDOMChar s_piTarget[]; 00230 00231 static const XalanDOMChar s_piData[]; 00232 00233 #if defined(XALAN_INLINE_INITIALIZATION) 00234 static const XalanDOMString::size_type s_piTargetLength = 5; 00235 static const XalanDOMString::size_type s_piDataLength = 3; 00236 #else 00237 static const XalanDOMString::size_type s_piTargetLength; 00238 static const XalanDOMString::size_type s_piDataLength; 00239 #endif 00240 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
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSLT Processor Version 1.9 |
|