00001 /* 00002 * The Apache Software License, Version 1.1 00003 * 00004 * 00005 * Copyright (c) 1999 The Apache Software Foundation. All rights 00006 * reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 00015 * 2. Redistributions in binary form must reproduce the above copyright 00016 * notice, this list of conditions and the following disclaimer in 00017 * the documentation and/or other materials provided with the 00018 * distribution. 00019 * 00020 * 3. The end-user documentation included with the redistribution, 00021 * if any, must include the following acknowledgment: 00022 * "This product includes software developed by the 00023 * Apache Software Foundation (http://www.apache.org/)." 00024 * Alternately, this acknowledgment may appear in the software itself, 00025 * if and wherever such third-party acknowledgments normally appear. 00026 * 00027 * 4. The names "Xalan" and "Apache Software Foundation" must 00028 * not be used to endorse or promote products derived from this 00029 * software without prior written permission. For written 00030 * permission, please contact apache@apache.org. 00031 * 00032 * 5. Products derived from this software may not be called "Apache", 00033 * nor may "Apache" appear in their name, without prior written 00034 * permission of the Apache Software Foundation. 00035 * 00036 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 00037 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00038 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00039 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR 00040 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00041 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00042 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 00043 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00044 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00045 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00046 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00047 * SUCH DAMAGE. 00048 * ==================================================================== 00049 * 00050 * This software consists of voluntary contributions made by many 00051 * individuals on behalf of the Apache Software Foundation and was 00052 * originally based on software copyright (c) 1999, International 00053 * Business Machines, Inc., http://www.ibm.com. For more 00054 * information on the Apache Software Foundation, please see 00055 * <http://www.apache.org/>. 00056 * 00057 * $ Id: $ 00058 00059 */ 00060 00061 #if !defined(XALAN_XSLTRESULTTARGET_HEADER_GUARD) 00062 #define XALAN_XSLTRESULTTARGET_HEADER_GUARD 00063 00064 // Base include file. Must be first. 00065 #include "XSLTDefinitions.hpp" 00066 00067 00068 00069 #if defined(XALAN_OLD_STREAM_HEADERS) 00070 #include <iostream.h> 00071 #else 00072 #if defined(XALAN_NO_IOSFWD) 00073 #include <ostream> 00074 #else 00075 #include <iosfwd> 00076 #endif 00077 #endif 00078 00079 00080 00081 #include <XalanDOM/XalanDOMString.hpp> 00082 00083 00084 00085 class FormatterListener; 00086 class XalanDocument; 00087 class XalanDocumentFragment; 00088 class XalanElement; 00089 class Writer; 00090 00091 00092 00093 class XALAN_XSLT_EXPORT XSLTResultTarget 00094 { 00095 public: 00096 00097 explicit 00098 XSLTResultTarget(); 00099 00105 XSLTResultTarget(const XalanDOMString& fileName); 00106 00112 XSLTResultTarget(const char* fileName); 00113 00119 #if defined(XALAN_NO_NAMESPACES) 00120 XSLTResultTarget(ostream* theStream); 00121 #else 00122 XSLTResultTarget(std::ostream* theStream); 00123 #endif 00124 00130 #if defined(XALAN_NO_NAMESPACES) 00131 XSLTResultTarget(ostream& theStream); 00132 #else 00133 XSLTResultTarget(std::ostream& theStream); 00134 #endif 00135 00142 XSLTResultTarget(Writer* characterStream); 00143 00149 XSLTResultTarget(XalanDocument* document); 00150 00156 XSLTResultTarget(XalanDocumentFragment* documentFragment); 00157 00163 XSLTResultTarget(XalanElement* element); 00164 00170 void 00171 setFileName(const XalanDOMString& fileName) 00172 { 00173 m_fileName = fileName; 00174 } 00175 00181 const XalanDOMString& 00182 getFileName() const 00183 { 00184 return m_fileName; 00185 } 00186 00193 void 00194 #if defined(XALAN_NO_NAMESPACES) 00195 setByteStream(ostream* byteStream) 00196 #else 00197 setByteStream(std::ostream* byteStream) 00198 #endif 00199 { 00200 m_byteStream = byteStream; 00201 } 00202 00208 #if defined(XALAN_NO_NAMESPACES) 00209 ostream* 00210 #else 00211 std::ostream* 00212 #endif 00213 getByteStream() const 00214 { 00215 return m_byteStream; 00216 } 00217 00223 void 00224 setEncoding(const XalanDOMString& encoding) 00225 { 00226 m_encoding = encoding; 00227 } 00228 00234 const XalanDOMString& 00235 getEncoding() const 00236 { 00237 return m_encoding; 00238 } 00239 00246 void 00247 setCharacterStream(Writer* characterStream) 00248 { 00249 m_characterStream = characterStream; 00250 } 00251 00257 Writer* 00258 getCharacterStream() const 00259 { 00260 return m_characterStream; 00261 } 00262 00263 bool 00264 hasDOMTarget() const 00265 { 00266 return m_document != 0 || m_documentFragment != 0 || m_element != 0; 00267 } 00268 00274 void 00275 setDocument(XalanDocument* document) 00276 { 00277 m_document = document; 00278 00279 m_documentFragment = 0; 00280 m_element = 0; 00281 } 00282 00288 XalanDocument* 00289 getDocument() const 00290 { 00291 return m_document; 00292 } 00293 00299 void 00300 setDocumentFragment(XalanDocumentFragment* documentFragment) 00301 { 00302 m_documentFragment = documentFragment; 00303 00304 m_document = 0; 00305 m_element = 0; 00306 } 00307 00313 XalanDocumentFragment* 00314 getDocumentFragment() const 00315 { 00316 return m_documentFragment; 00317 } 00318 00324 void 00325 setElement(XalanElement* element) 00326 { 00327 m_element = element; 00328 00329 m_documentFragment = 0; 00330 m_document = 0; 00331 } 00332 00338 XalanElement* 00339 getElement() const 00340 { 00341 return m_element; 00342 } 00343 00349 void 00350 setDocumentHandler(FormatterListener* handler) 00351 { 00352 m_formatterListener = handler; 00353 } 00354 00360 FormatterListener* 00361 getDocumentHandler() const 00362 { 00363 return m_formatterListener; 00364 } 00365 00371 void 00372 setFormatterListener(FormatterListener* handler) 00373 { 00374 m_formatterListener = handler; 00375 } 00376 00382 FormatterListener* 00383 getFormatterListener() const 00384 { 00385 return m_formatterListener; 00386 } 00387 00388 private: 00389 00390 XalanDOMString m_fileName; 00391 00392 #if defined(XALAN_NO_NAMESPACES) 00393 ostream* m_byteStream; 00394 #else 00395 std::ostream* m_byteStream; 00396 #endif 00397 00398 XalanDOMString m_encoding; 00399 00400 Writer* m_characterStream; 00401 00402 XalanDocument* m_document; 00403 00404 XalanDocumentFragment* m_documentFragment; 00405 00406 XalanElement* m_element; 00407 00408 FormatterListener* m_formatterListener; 00409 }; 00410 00411 00412 00413 #endif // XALAN_XSLTRESULTTARGET_HEADER_GUARD
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSL Transformer Version 1.1 |
|