Xalan-C++ API Documentation

The Xalan C++ XSLT Processor Version 1.4

Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

XercesParserLiaison.hpp

Go to the documentation of this file.
00001 /*
00002  * The Apache Software License, Version 1.1
00003  *
00004  *
00005  * Copyright (c) 1999-2002 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 <xercesc/sax/ErrorHandler.hpp>
00073 
00074 
00075 
00076 // Base class header file.
00077 #include <XMLSupport/XMLParserLiaison.hpp>
00078 
00079 
00080 
00081 class DOM_Document;
00082 class DOMParser;
00083 class DOMSupport;
00084 class EntityResolver;
00085 class InputSource;
00086 class SAXParser;
00087 class XercesDOMSupport;
00088 class XercesDocumentBridge;
00089 class XSLProcessor;
00090 
00091 
00092 
00093 class XALAN_XERCESPARSERLIAISON_EXPORT XercesParserLiaison : public XMLParserLiaison, public ErrorHandler
00094 {
00095 public:
00096 
00104     XercesParserLiaison(XercesDOMSupport&   theSupport);
00105 
00109     XercesParserLiaison();
00110 
00111     virtual
00112     ~XercesParserLiaison();
00113 
00114     // These interfaces are inherited from XMLParserLiaison...
00115 
00116     virtual void
00117     reset();
00118 
00119     virtual ExecutionContext*
00120     getExecutionContext() const;
00121 
00122     virtual void
00123     setExecutionContext(ExecutionContext&   theContext);
00124 
00125     virtual XalanDocument*
00126     parseXMLStream(
00127             const InputSource&      reader,
00128             const XalanDOMString&   identifier = XalanDOMString());
00129 
00130     virtual void
00131     parseXMLStream(
00132             const InputSource&      urlInputSource,
00133             DocumentHandler&        handler,
00134             const XalanDOMString&   identifier = XalanDOMString());
00135 
00136     // Create a non-thread safe document, with no synchronization and no bridge...
00137     virtual XalanDocument*
00138     createDocument();
00139 
00140     // Create a non-thread safe document, with no synchronization and no bridge...
00141     virtual XalanDocument*
00142     createDOMFactory();
00143 
00144     virtual void
00145     destroyDocument(XalanDocument*  theDocument);
00146 
00147     virtual int
00148     getIndent() const;
00149 
00150     virtual void
00151     setIndent(int   i);
00152 
00153     virtual bool
00154     getUseValidation() const;
00155 
00156     virtual void
00157     setUseValidation(bool   b);
00158 
00159     virtual const XalanDOMString
00160     getParserDescription() const;
00161 
00162     virtual EntityResolver*
00163     getEntityResolver() const;
00164 
00165     virtual void
00166     setEntityResolver(EntityResolver*   resolver);
00167 
00168 
00169     // These interfaces are new to XercesParserLiaison...
00170 
00181     virtual bool
00182     getIncludeIgnorableWhitespace() const;
00183 
00202     virtual void
00203     setIncludeIgnorableWhitespace(bool  include);
00204 
00210     virtual ErrorHandler*
00211     getErrorHandler() const;
00212 
00221     virtual void
00222     setErrorHandler(ErrorHandler*   handler);
00223 
00233     virtual bool
00234     getDoNamespaces() const;
00235 
00253     virtual void
00254     setDoNamespaces(bool    newState);
00255 
00265     virtual bool
00266     getExitOnFirstFatalError() const;
00267 
00283     virtual void
00284     setExitOnFirstFatalError(bool   newState);
00285 
00292     virtual const XalanDOMChar*
00293     getExternalSchemaLocation() const;
00294 
00301     virtual void
00302     setExternalSchemaLocation(const XalanDOMChar*   location);
00303 
00310     virtual const XalanDOMChar*
00311     getExternalNoNamespaceSchemaLocation() const;
00312 
00319     virtual void
00320     setExternalNoNamespaceSchemaLocation(const XalanDOMChar*    location);
00321 
00333     virtual XalanDocument*
00334     createDocument(
00335             const DOM_Document&     theXercesDocument,
00336             bool                    threadSafe = false,
00337             bool                    buildBridge = false);
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 
00391     bool
00392     getBuildBridgeNodes() const
00393     
00394     {
00395         return m_buildBridge;
00396     }
00397 
00407     void
00408     setBuildBridgeNodes(bool    newState)
00409     {
00410         m_buildBridge = newState;
00411 
00412         if (newState == false)
00413         {
00414             m_threadSafe = false;
00415         }
00416     }
00417 
00427     bool
00428     getThreadSafe() const
00429     
00430     {
00431         return m_threadSafe;
00432     }
00433 
00443     void
00444     setThreadSafe(bool  newState)
00445     {
00446         m_threadSafe = newState;
00447 
00448         if (m_threadSafe == true)
00449         {
00450             m_buildBridge = true;
00451         }
00452     }
00453 
00454 protected:
00455 
00456     static void
00457     formatErrorMessage(
00458             const SAXParseException&    e,
00459             XalanDOMString&             theMessage);
00460 
00461     virtual DOMParser*
00462     CreateDOMParser();
00463 
00464     virtual SAXParser*
00465     CreateSAXParser();
00466 
00475     virtual XercesDocumentBridge*
00476     doCreateDocument(
00477             const DOM_Document&     theXercesDocument,
00478             bool                    threadSafe,
00479             bool                    buildBridge);
00480 
00481 private:
00482 
00483     // Data members...
00484     int                 m_indent;
00485 
00486     bool                m_useValidation;
00487 
00488     bool                m_includeIgnorableWhitespace;
00489 
00490     bool                m_doNamespaces;
00491 
00492     bool                m_exitOnFirstFatalError;
00493 
00494     EntityResolver*     m_entityResolver;
00495 
00496     ErrorHandler*       m_errorHandler;
00497 
00498     XalanDOMString      m_externalSchemaLocation;
00499 
00500     XalanDOMString      m_externalNoNamespaceSchemaLocation;
00501 
00502     DocumentMapType     m_documentMap;
00503 
00504     bool                m_buildBridge;
00505 
00506     bool                m_threadSafe;
00507 
00508     ExecutionContext*   m_executionContext;
00509 };
00510 
00511 
00512 
00513 #endif  // XercesPARSERLIAISON_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.4
Copyright © 2000, 2001, 2002 The Apache Software Foundation. All Rights Reserved.