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 #if !defined(XercesPARSERLIAISON_HEADER_GUARD_1357924680) 00058 #define XercesPARSERLIAISON_HEADER_GUARD_1357924680 00059 00060 00061 // Base include file. Must be first. 00062 #include <XercesParserLiaison/XercesParserLiaisonDefinitions.hpp> 00063 00064 00065 00066 // Standard Library header files. 00067 #include <map> 00068 00069 00070 00071 // Xerces DOM header files 00072 #include <util/XercesDefs.hpp> 00073 #include <sax/ErrorHandler.hpp> 00074 #include <dom/DOM_Document.hpp> 00075 00076 00077 00078 // Base class header file. 00079 #include <XMLSupport/XMLParserLiaison.hpp> 00080 00081 00082 00083 class DOMParser; 00084 class DOMSupport; 00085 class EntityResolver; 00086 class InputSource; 00087 class SAXParser; 00088 class XercesDocumentBridge; 00089 class XSLProcessor; 00090 00091 00092 00093 class XALAN_XERCESPARSERLIAISON_EXPORT XercesParserLiaison : public XMLParserLiaison, public ErrorHandler 00094 { 00095 public: 00096 00102 XercesParserLiaison(DOMSupport& theSupport); 00103 00104 virtual 00105 ~XercesParserLiaison(); 00106 00107 // These interfaces are inherited from XMLParserLiaison... 00108 00109 virtual void 00110 reset(); 00111 00112 virtual bool 00113 supportsSAX() const; 00114 00115 virtual XalanDocument* 00116 parseXMLStream( 00117 InputSource& reader, 00118 const XalanDOMString& identifier = XalanDOMString()); 00119 00120 virtual void 00121 parseXMLStream( 00122 InputSource& urlInputSource, 00123 DocumentHandler& handler, 00124 const XalanDOMString& identifier = XalanDOMString()); 00125 00126 virtual XalanDocument* 00127 createDocument(); 00128 00129 virtual XalanDocument* 00130 getDOMFactory(); 00131 00132 virtual XalanDOMString 00133 getExpandedElementName(const XalanElement& elem) const; 00134 00135 virtual XalanDOMString 00136 getExpandedAttributeName(const XalanAttr& attr) const; 00137 00138 virtual void 00139 setSpecialCharacters(const XalanDOMString& str); 00140 00141 virtual const XalanDOMString& 00142 getSpecialCharacters() const; 00143 00144 virtual int 00145 getIndent() const; 00146 00147 virtual void 00148 setIndent(int i); 00149 00150 virtual bool 00151 getShouldExpandEntityRefs() const; 00152 00153 virtual void 00154 SetShouldExpandEntityRefs(bool b); 00155 00156 virtual bool 00157 getUseValidation() const; 00158 00159 virtual void 00160 setUseValidation(bool b); 00161 00162 virtual const XalanDOMString 00163 getParserDescription() const; 00164 00165 00166 // These interfaces are new to XercesParserLiaison... 00167 00178 virtual bool 00179 getIncludeIgnorableWhitespace() const; 00180 00199 virtual void 00200 setIncludeIgnorableWhitespace(bool include); 00201 00208 virtual ErrorHandler* 00209 getErrorHandler(); 00210 00217 virtual const ErrorHandler* 00218 getErrorHandler() const; 00219 00230 virtual void 00231 setErrorHandler(ErrorHandler* handler); 00232 00242 virtual bool 00243 getDoNamespaces() const; 00244 00262 virtual void 00263 setDoNamespaces(bool newState); 00264 00274 virtual bool 00275 getExitOnFirstFatalError() const; 00276 00292 virtual void 00293 setExitOnFirstFatalError(bool newState); 00294 00301 virtual EntityResolver* 00302 getEntityResolver(); 00303 00310 virtual const EntityResolver* 00311 getEntityResolver() const; 00312 00324 virtual void 00325 setEntityResolver(EntityResolver* resolver); 00326 00336 virtual XalanDocument* 00337 createDocument(const DOM_Document& theXercesDocument); 00338 00348 XercesDocumentBridge* 00349 mapDocument(const XalanDocument* theDocument) const; 00350 00360 DOM_Document 00361 mapXercesDocument(const XalanDocument* theDocument) const; 00362 00363 // Implementations for SAX ErrorHandler 00364 00365 virtual void 00366 warning(const SAXParseException& exception); 00367 00368 virtual void 00369 error(const SAXParseException& exception); 00370 00371 virtual void 00372 fatalError(const SAXParseException& exception); 00373 00374 virtual void 00375 resetErrors(); 00376 00377 #if defined(XALAN_NO_NAMESPACES) 00378 typedef map<const XalanDocument*, 00379 XercesDocumentBridge*, 00380 less<const XalanDocument*> > DocumentMapType; 00381 #else 00382 typedef std::map<const XalanDocument*, 00383 XercesDocumentBridge*> DocumentMapType; 00384 #endif 00385 00386 protected: 00387 00388 virtual DOMParser* 00389 CreateDOMParser(); 00390 00391 virtual SAXParser* 00392 CreateSAXParser(); 00393 00401 virtual XercesDocumentBridge* 00402 createDocument( 00403 const DOM_Document& theXercesDocument, 00404 bool buildBridge); 00405 00406 private: 00407 00408 // Data members... 00409 DOMSupport& m_DOMSupport; 00410 00411 XalanDOMString m_specialCharacters; 00412 00413 int m_indent; 00414 00415 bool m_shouldExpandEntityRefs; 00416 00417 bool m_useValidation; 00418 00419 bool m_includeIgnorableWhitespace; 00420 00421 bool m_doNamespaces; 00422 00423 bool m_exitOnFirstFatalError; 00424 00425 EntityResolver* m_entityResolver; 00426 00427 ErrorHandler* m_errorHandler; 00428 00429 DocumentMapType m_documentMap; 00430 }; 00431 00432 00433 00434 #endif // XercesPARSERLIAISON_HEADER_GUARD_1357924680
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
![]() |
Xalan-C++ XSL Transformer Version 1.0 |
|