http://xml.apache.org/http://www.apache.org/http://www.w3.org/

Home

Readme
Release Info

Installation
Download
Build

FAQs
Samples
API Docs

DOM C++ Binding
Programming
Migration Guide

Feedback
Bug-Reporting
PDF Document

CVS Repository
Mail Archive

API Docs for SAX and DOM
 

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

SAXParser.hpp

Go to the documentation of this file.
00001 /*
00002  * The Apache Software License, Version 1.1
00003  *
00004  * Copyright (c) 1999-2001 The Apache Software Foundation.  All rights
00005  * reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  *
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in
00016  *    the documentation and/or other materials provided with the
00017  *    distribution.
00018  *
00019  * 3. The end-user documentation included with the redistribution,
00020  *    if any, must include the following acknowledgment:
00021  *       "This product includes software developed by the
00022  *        Apache Software Foundation (http://www.apache.org/)."
00023  *    Alternately, this acknowledgment may appear in the software itself,
00024  *    if and wherever such third-party acknowledgments normally appear.
00025  *
00026  * 4. The names "Xerces" and "Apache Software Foundation" must
00027  *    not be used to endorse or promote products derived from this
00028  *    software without prior written permission. For written
00029  *    permission, please contact apache\@apache.org.
00030  *
00031  * 5. Products derived from this software may not be called "Apache",
00032  *    nor may "Apache" appear in their name, without prior written
00033  *    permission of the Apache Software Foundation.
00034  *
00035  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
00036  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00037  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00038  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
00039  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00040  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00041  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
00042  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
00043  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00044  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00045  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00046  * SUCH DAMAGE.
00047  * ====================================================================
00048  *
00049  * This software consists of voluntary contributions made by many
00050  * individuals on behalf of the Apache Software Foundation, and was
00051  * originally based on software copyright (c) 1999, International
00052  * Business Machines, Inc., http://www.ibm.com .  For more information
00053  * on the Apache Software Foundation, please see
00054  * <http://www.apache.org/>.
00055  */
00056 
00057 /*
00058  * $Log: SAXParser.hpp,v $
00059  * Revision 1.20  2003/02/04 19:27:43  knoaman
00060  * Performance: use global buffer to eliminate repetitive memory creation/deletion.
00061  *
00062  * Revision 1.19  2003/01/09 19:07:08  tng
00063  * [Bug 15802] Add "const" qualifier to getURIText.
00064  *
00065  * Revision 1.18  2003/01/03 20:09:36  tng
00066  * New feature StandardUriConformant to force strict standard uri conformance.
00067  *
00068  * Revision 1.17  2002/12/30 20:15:51  knoaman
00069  * Make calculate src offset option false by default.
00070  *
00071  * Revision 1.16  2002/12/23 15:23:18  knoaman
00072  * Added a public api to various parsers to return the src offset within the input
00073  * source.
00074  *
00075  * Revision 1.15  2002/12/04 01:57:09  knoaman
00076  * Scanner re-organization.
00077  *
00078  * Revision 1.14  2002/11/04 14:57:03  tng
00079  * C++ Namespace Support.
00080  *
00081  * Revision 1.13  2002/08/14 15:20:38  knoaman
00082  * [Bug 3111] Problem with LexicalHandler::startDTD() and LexicalHandler::endDTD().
00083  *
00084  * Revision 1.12  2002/07/11 18:27:03  knoaman
00085  * Grammar caching/preparsing - initial implementation.
00086  *
00087  * Revision 1.11  2002/06/27 18:48:04  tng
00088  * API Documentation Update and move getScanner as protected
00089  *
00090  * Revision 1.10  2002/06/17 15:41:44  tng
00091  * Update API Documentation
00092  *
00093  * Revision 1.9  2002/06/06 20:38:18  tng
00094  * Document Fix: document that the returned object from resolveEntity is owned by the parser
00095  *
00096  * Revision 1.8  2002/05/31 15:13:53  tng
00097  * Fix doxygen documentation.
00098  *
00099  * Revision 1.7  2002/05/30 16:39:06  knoaman
00100  * DOM L3 LS.
00101  *
00102  * Revision 1.6  2002/05/30 16:20:09  tng
00103  * Add feature to optionally ignore external DTD.
00104  *
00105  * Revision 1.5  2002/05/29 21:37:47  knoaman
00106  * Add baseURI to resolveEntity to support DOMInputSource.
00107  *
00108  * Revision 1.4  2002/05/28 20:44:14  tng
00109  * [Bug 9104] prefixes dissapearing when schema validation turned on.
00110  *
00111  * Revision 1.3  2002/05/27 18:39:21  tng
00112  * To get ready for 64 bit large file, use XMLSSize_t to represent line and column number.
00113  *
00114  * Revision 1.2  2002/02/20 18:17:01  tng
00115  * [Bug 5977] Warnings on generating apiDocs.
00116  *
00117  * Revision 1.1.1.1  2002/02/01 22:22:07  peiyongz
00118  * sane_include
00119  *
00120  * Revision 1.22  2001/12/05 22:09:02  tng
00121  * Update documentation for setExternalSchemaLocation and setExternalNoNamespaceSchemaLocation.
00122  *
00123  * Revision 1.21  2001/11/20 18:51:44  tng
00124  * Schema: schemaLocation and noNamespaceSchemaLocation to be specified outside the instance document.  New methods setExternalSchemaLocation and setExternalNoNamespaceSchemaLocation are added (for SAX2, two new properties are added).
00125  *
00126  * Revision 1.20  2001/08/01 19:11:02  tng
00127  * Add full schema constraint checking flag to the samples and the parser.
00128  *
00129  * Revision 1.19  2001/07/27 20:24:21  tng
00130  * put getScanner() back as they were there before, not to break existing apps.
00131  *
00132  * Revision 1.18  2001/07/16 12:52:09  tng
00133  * APIDocs fix: default for schema processing in DOMParser, IDOMParser, and SAXParser should be false.
00134  *
00135  * Revision 1.17  2001/06/23 14:13:16  tng
00136  * Remove getScanner from the Parser headers as this is not needed and Scanner is not internal class.
00137  *
00138  * Revision 1.16  2001/06/03 19:26:20  jberry
00139  * Add support for querying error count following parse; enables simple parse without requiring error handler.
00140  *
00141  * Revision 1.15  2001/05/11 13:26:22  tng
00142  * Copyright update.
00143  *
00144  * Revision 1.14  2001/05/03 19:09:25  knoaman
00145  * Support Warning/Error/FatalError messaging.
00146  * Validity constraints errors are treated as errors, with the ability by user to set
00147  * validity constraints as fatal errors.
00148  *
00149  * Revision 1.13  2001/03/30 16:46:57  tng
00150  * Schema: Use setDoSchema instead of setSchemaValidation which makes more sense.
00151  *
00152  * Revision 1.12  2001/03/21 21:56:09  tng
00153  * Schema: Add Schema Grammar, Schema Validator, and split the DTDValidator into DTDValidator, DTDScanner, and DTDGrammar.
00154  *
00155  * Revision 1.11  2001/02/15 15:56:29  tng
00156  * Schema: Add setSchemaValidation and getSchemaValidation for DOMParser and SAXParser.
00157  * Add feature "http://apache.org/xml/features/validation/schema" for SAX2XMLReader.
00158  * New data field  fSchemaValidation in XMLScanner as the flag.
00159  *
00160  * Revision 1.10  2001/01/12 21:23:41  tng
00161  * Documentation Enhancement: explain values of Val_Scheme
00162  *
00163  * Revision 1.9  2000/08/02 18:05:15  jpolast
00164  * changes required for sax2
00165  * (changed private members to protected)
00166  *
00167  * Revision 1.8  2000/04/12 22:58:30  roddey
00168  * Added support for 'auto validate' mode.
00169  *
00170  * Revision 1.7  2000/03/03 01:29:34  roddey
00171  * Added a scanReset()/parseReset() method to the scanner and
00172  * parsers, to allow for reset after early exit from a progressive parse.
00173  * Added calls to new Terminate() call to all of the samples. Improved
00174  * documentation in SAX and DOM parsers.
00175  *
00176  * Revision 1.6  2000/02/17 03:54:27  rahulj
00177  * Added some new getters to query the parser state and
00178  * clarified the documentation.
00179  *
00180  * Revision 1.5  2000/02/16 03:42:58  rahulj
00181  * Finished documenting the SAX Driver implementation.
00182  *
00183  * Revision 1.4  2000/02/15 04:47:37  rahulj
00184  * Documenting the SAXParser framework. Not done yet.
00185  *
00186  * Revision 1.3  2000/02/06 07:47:56  rahulj
00187  * Year 2K copyright swat.
00188  *
00189  * Revision 1.2  1999/12/15 19:57:48  roddey
00190  * Got rid of redundant 'const' on boolean return value. Some compilers choke
00191  * on this and its useless.
00192  *
00193  * Revision 1.1.1.1  1999/11/09 01:07:51  twl
00194  * Initial checkin
00195  *
00196  * Revision 1.6  1999/11/08 20:44:54  rahul
00197  * Swat for adding in Product name and CVS comment log variable.
00198  *
00199  */
00200 
00201 #if !defined(SAXPARSER_HPP)
00202 #define SAXPARSER_HPP
00203 
00204 #include <xercesc/sax/Parser.hpp>
00205 #include <xercesc/internal/VecAttrListImpl.hpp>
00206 #include <xercesc/framework/XMLDocumentHandler.hpp>
00207 #include <xercesc/framework/XMLElementDecl.hpp>
00208 #include <xercesc/framework/XMLEntityHandler.hpp>
00209 #include <xercesc/framework/XMLErrorReporter.hpp>
00210 #include <xercesc/framework/XMLBuffer.hpp>
00211 #include <xercesc/validators/DTD/DocTypeHandler.hpp>
00212 
00213 XERCES_CPP_NAMESPACE_BEGIN
00214 
00215 
00216 class DocumentHandler;
00217 class EntityResolver;
00218 class XMLPScanToken;
00219 class XMLScanner;
00220 class XMLValidator;
00221 class Grammar;
00222 class GrammarResolver;
00223 
00224 
00235 class  SAXParser :
00236 
00237     public Parser
00238     , public XMLDocumentHandler
00239     , public XMLErrorReporter
00240     , public XMLEntityHandler
00241     , public DocTypeHandler
00242 {
00243 public :
00244     // -----------------------------------------------------------------------
00245     //  Class types
00246     // -----------------------------------------------------------------------
00255     enum ValSchemes
00256     {
00257         Val_Never
00258         , Val_Always
00259         , Val_Auto
00260     };
00261 
00262 
00263     // -----------------------------------------------------------------------
00264     //  Constructors and Destructor
00265     // -----------------------------------------------------------------------
00273     SAXParser(XMLValidator* const valToAdopt = 0);
00274 
00278     ~SAXParser();
00280 
00281 
00282     // -----------------------------------------------------------------------
00283     //  Getter Methods
00284     // -----------------------------------------------------------------------
00293     DocumentHandler* getDocumentHandler();
00294 
00301     const DocumentHandler* getDocumentHandler() const;
00302 
00309     EntityResolver* getEntityResolver();
00310 
00317     const EntityResolver* getEntityResolver() const;
00318 
00325     ErrorHandler* getErrorHandler();
00326 
00333     const ErrorHandler* getErrorHandler() const;
00334 
00341     const XMLValidator& getValidator() const;
00342 
00350     ValSchemes getValidationScheme() const;
00351 
00362     bool getDoSchema() const;
00363 
00374     bool getValidationSchemaFullChecking() const;
00375 
00386     int getErrorCount() const;
00387 
00397     bool getDoNamespaces() const;
00398 
00408     bool getExitOnFirstFatalError() const;
00409 
00420     bool getValidationConstraintFatal() const;
00421 
00441     XMLCh* getExternalSchemaLocation() const;
00442 
00462     XMLCh* getExternalNoNamespaceSchemaLocation() const;
00463 
00475     bool getLoadExternalDTD() const;
00476 
00487     bool isCachingGrammarFromParse() const;
00488 
00499     bool isUsingCachedGrammarInParse() const;
00500 
00512     bool getCalculateSrcOfs() const;
00513 
00524     bool getStandardUriConformant() const;
00525 
00532     Grammar* getGrammar(const XMLCh* const nameSpaceKey);
00533 
00539     Grammar* getRootGrammar();
00540 
00547     const XMLCh* getURIText(unsigned int uriId) const;
00548 
00554     unsigned int getSrcOffset() const;
00555 
00557 
00558 
00559     // -----------------------------------------------------------------------
00560     //  Setter methods
00561     // -----------------------------------------------------------------------
00562 
00578     void setDoNamespaces(const bool newState);
00579 
00596     void setValidationScheme(const ValSchemes newScheme);
00597 
00613     void setDoSchema(const bool newState);
00614 
00631     void setValidationSchemaFullChecking(const bool schemaFullChecking);
00632 
00648     void setExitOnFirstFatalError(const bool newState);
00649 
00669     void setValidationConstraintFatal(const bool newState);
00670 
00691     void setExternalSchemaLocation(const XMLCh* const schemaLocation);
00692 
00701     void setExternalSchemaLocation(const char* const schemaLocation);
00702 
00717     void setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation);
00718 
00727     void setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation);
00728 
00745     void setLoadExternalDTD(const bool newState);
00746 
00764     void cacheGrammarFromParse(const bool newState);
00765 
00784     void useCachedGrammarInParse(const bool newState);
00785 
00798     void setCalculateSrcOfs(const bool newState);
00799 
00810     void setStandardUriConformant(const bool newState);
00811 
00819     void useScanner(const XMLCh* const scannerName);
00820 
00822 
00823 
00824     // -----------------------------------------------------------------------
00825     //  Advanced document handler list maintenance methods
00826     // -----------------------------------------------------------------------
00827 
00843     void installAdvDocHandler(XMLDocumentHandler* const toInstall);
00844 
00854     bool removeAdvDocHandler(XMLDocumentHandler* const toRemove);
00856 
00857 
00858     // -----------------------------------------------------------------------
00859     //  Progressive scan methods
00860     // -----------------------------------------------------------------------
00861 
00864 
00892     bool parseFirst
00893     (
00894         const   XMLCh* const    systemId
00895         ,       XMLPScanToken&  toFill
00896     );
00897 
00925     bool parseFirst
00926     (
00927         const   char* const     systemId
00928         ,       XMLPScanToken&  toFill
00929     );
00930 
00958     bool parseFirst
00959     (
00960         const   InputSource&    source
00961         ,       XMLPScanToken&  toFill
00962     );
00963 
00988     bool parseNext(XMLPScanToken& token);
00989 
01011     void parseReset(XMLPScanToken& token);
01012 
01014 
01015     // -----------------------------------------------------------------------
01016     //  Grammar preparsing interface
01017     // -----------------------------------------------------------------------
01018 
01048     Grammar* loadGrammar(const InputSource& source,
01049                          const short grammarType,
01050                          const bool toCache = false);
01051 
01077     Grammar* loadGrammar(const XMLCh* const systemId,
01078                          const short grammarType,
01079                          const bool toCache = false);
01080 
01105     Grammar* loadGrammar(const char* const systemId,
01106                          const short grammarType,
01107                          const bool toCache = false);
01108 
01112     void resetCachedGrammarPool();
01113 
01115 
01116 
01117     // -----------------------------------------------------------------------
01118     //  Implementation of the SAX Parser interface
01119     // -----------------------------------------------------------------------
01120 
01132     virtual void parse(const InputSource& source);
01133 
01143     virtual void parse(const XMLCh* const systemId);
01144 
01152     virtual void parse(const char* const systemId);
01153 
01164     virtual void setDocumentHandler(DocumentHandler* const handler);
01165 
01175     virtual void setDTDHandler(DTDHandler* const handler);
01176 
01187     virtual void setErrorHandler(ErrorHandler* const handler);
01188 
01200     virtual void setEntityResolver(EntityResolver* const resolver);
01202 
01203 
01204     // -----------------------------------------------------------------------
01205     //  Implementation of the XMLDocumentHandler interface
01206     // -----------------------------------------------------------------------
01207 
01225     virtual void docCharacters
01226     (
01227         const   XMLCh* const    chars
01228         , const unsigned int    length
01229         , const bool            cdataSection
01230     );
01231 
01241     virtual void docComment
01242     (
01243         const   XMLCh* const    comment
01244     );
01245 
01265     virtual void docPI
01266     (
01267         const   XMLCh* const    target
01268         , const XMLCh* const    data
01269     );
01270 
01282     virtual void endDocument();
01283 
01303     virtual void endElement
01304     (
01305         const   XMLElementDecl& elemDecl
01306         , const unsigned int    urlId
01307         , const bool            isRoot
01308         , const XMLCh* const    elemPrefix
01309     );
01310 
01321     virtual void endEntityReference
01322     (
01323         const   XMLEntityDecl&  entDecl
01324     );
01325 
01345     virtual void ignorableWhitespace
01346     (
01347         const   XMLCh* const    chars
01348         , const unsigned int    length
01349         , const bool            cdataSection
01350     );
01351 
01356     virtual void resetDocument();
01357 
01368     virtual void startDocument();
01369 
01396     virtual void startElement
01397     (
01398         const   XMLElementDecl&         elemDecl
01399         , const unsigned int            urlId
01400         , const XMLCh* const            elemPrefix
01401         , const RefVectorOf<XMLAttr>&   attrList
01402         , const unsigned int            attrCount
01403         , const bool                    isEmpty
01404         , const bool                    isRoot
01405     );
01406 
01416     virtual void startEntityReference
01417     (
01418         const   XMLEntityDecl&  entDecl
01419     );
01420 
01438     virtual void XMLDecl
01439     (
01440         const   XMLCh* const    versionStr
01441         , const XMLCh* const    encodingStr
01442         , const XMLCh* const    standaloneStr
01443         , const XMLCh* const    actualEncodingStr
01444     );
01446 
01447 
01448     // -----------------------------------------------------------------------
01449     //  Implementation of the XMLErrorReporter interface
01450     // -----------------------------------------------------------------------
01451 
01477     virtual void error
01478     (
01479         const   unsigned int                errCode
01480         , const XMLCh* const                msgDomain
01481         , const XMLErrorReporter::ErrTypes  errType
01482         , const XMLCh* const                errorText
01483         , const XMLCh* const                systemId
01484         , const XMLCh* const                publicId
01485         , const XMLSSize_t                  lineNum
01486         , const XMLSSize_t                  colNum
01487     );
01488 
01497     virtual void resetErrors();
01499 
01500 
01501     // -----------------------------------------------------------------------
01502     //  Implementation of the XMLEntityHandler interface
01503     // -----------------------------------------------------------------------
01504 
01518     virtual void endInputSource(const InputSource& inputSource);
01519 
01534     virtual bool expandSystemId
01535     (
01536         const   XMLCh* const    systemId
01537         ,       XMLBuffer&      toFill
01538     );
01539 
01547     virtual void resetEntities();
01548 
01569     virtual InputSource* resolveEntity
01570     (
01571         const   XMLCh* const    publicId
01572         , const XMLCh* const    systemId
01573         , const XMLCh* const    baseURI = 0
01574     );
01575 
01587     virtual void startInputSource(const InputSource& inputSource);
01589 
01590 
01591     // -----------------------------------------------------------------------
01592     //  Implementation of the Deprecated DocTypeHandler Interface
01593     // -----------------------------------------------------------------------
01610     virtual void attDef
01611     (
01612         const   DTDElementDecl& elemDecl
01613         , const DTDAttDef&      attDef
01614         , const bool            ignore
01615     );
01616 
01626     virtual void doctypeComment
01627     (
01628         const   XMLCh* const    comment
01629     );
01630 
01649     virtual void doctypeDecl
01650     (
01651         const   DTDElementDecl& elemDecl
01652         , const XMLCh* const    publicId
01653         , const XMLCh* const    systemId
01654         , const bool            hasIntSubset
01655         , const bool            hasExtSubset = false
01656     );
01657 
01671     virtual void doctypePI
01672     (
01673         const   XMLCh* const    target
01674         , const XMLCh* const    data
01675     );
01676 
01688     virtual void doctypeWhitespace
01689     (
01690         const   XMLCh* const    chars
01691         , const unsigned int    length
01692     );
01693 
01706     virtual void elementDecl
01707     (
01708         const   DTDElementDecl& decl
01709         , const bool            isIgnored
01710     );
01711 
01722     virtual void endAttList
01723     (
01724         const   DTDElementDecl& elemDecl
01725     );
01726 
01733     virtual void endIntSubset();
01734 
01741     virtual void endExtSubset();
01742 
01757     virtual void entityDecl
01758     (
01759         const   DTDEntityDecl&  entityDecl
01760         , const bool            isPEDecl
01761         , const bool            isIgnored
01762     );
01763 
01768     virtual void resetDocType();
01769 
01782     virtual void notationDecl
01783     (
01784         const   XMLNotationDecl&    notDecl
01785         , const bool                isIgnored
01786     );
01787 
01798     virtual void startAttList
01799     (
01800         const   DTDElementDecl& elemDecl
01801     );
01802 
01809     virtual void startIntSubset();
01810 
01817     virtual void startExtSubset();
01818 
01831     virtual void TextDecl
01832     (
01833         const   XMLCh* const    versionStr
01834         , const XMLCh* const    encodingStr
01835     );
01837 
01838 
01839     // -----------------------------------------------------------------------
01840     //  Deprecated Methods
01841     // -----------------------------------------------------------------------
01854     bool getDoValidation() const;
01855 
01869     void setDoValidation(const bool newState);
01871 
01872 
01873 protected :
01874     // -----------------------------------------------------------------------
01875     //  Protected Methods
01876     // -----------------------------------------------------------------------
01883     const XMLScanner& getScanner() const;
01884 
01885 
01886 private:
01887     // -----------------------------------------------------------------------
01888     //  Unimplemented constructors and operators
01889     // -----------------------------------------------------------------------
01890     SAXParser(const SAXParser&);
01891     void operator=(const SAXParser&);
01892 
01893     // -----------------------------------------------------------------------
01894     //  Initialize/Cleanup methods
01895     // -----------------------------------------------------------------------
01896     void initialize();
01897     void cleanUp();
01898 
01899     // -----------------------------------------------------------------------
01900     //  Private data members
01901     //
01902     //  fAttrList
01903     //      A temporary implementation of the basic SAX attribute list
01904     //      interface. We use this one over and over on each startElement
01905     //      event to allow SAX-like access to the element attributes.
01906     //
01907     //  fDocHandler
01908     //      The installed SAX doc handler, if any. Null if none.
01909     //
01910     //  fDTDHandler
01911     //      The installed SAX DTD handler, if any. Null if none.
01912     //
01913     //  fElemDepth
01914     //      This is used to track the element nesting depth, so that we can
01915     //      know when we are inside content. This is so we can ignore char
01916     //      data outside of content.
01917     //
01918     //  fEntityResolver
01919     //      The installed SAX entity handler, if any. Null if none.
01920     //
01921     //  fErrorHandler
01922     //      The installed SAX error handler, if any. Null if none.
01923     //
01924     //  fAdvDHCount
01925     //  fAdvDHList
01926     //  fAdvDHListSize
01927     //      This is an array of pointers to XMLDocumentHandlers, which is
01928     //      how we see installed advanced document handlers. There will
01929     //      usually not be very many at all, so a simple array is used
01930     //      instead of a collection, for performance. It will grow if needed,
01931     //      but that is unlikely.
01932     //
01933     //      The count is how many handlers are currently installed. The size
01934     //      is how big the array itself is (for expansion purposes.) When
01935     //      count == size, is time to expand.
01936     //
01937     //  fParseInProgress
01938     //      This flag is set once a parse starts. It is used to prevent
01939     //      multiple entrance or reentrance of the parser.
01940     //
01941     //  fScanner
01942     //      The scanner being used by this parser. It is created internally
01943     //      during construction.
01944     //
01945     // -----------------------------------------------------------------------
01946     bool                 fParseInProgress;
01947     unsigned int         fElemDepth;
01948     unsigned int         fAdvDHCount;
01949     unsigned int         fAdvDHListSize;
01950     VecAttrListImpl      fAttrList;
01951     DocumentHandler*     fDocHandler;
01952     DTDHandler*          fDTDHandler;
01953     EntityResolver*      fEntityResolver;
01954     ErrorHandler*        fErrorHandler;
01955     XMLDocumentHandler** fAdvDHList;
01956     XMLScanner*          fScanner;
01957     GrammarResolver*     fGrammarResolver;
01958     XMLStringPool*       fURIStringPool;
01959     XMLValidator*        fValidator;
01960     XMLBuffer            fElemQNameBuf;
01961 };
01962 
01963 
01964 // ---------------------------------------------------------------------------
01965 //  SAXParser: Getter methods
01966 // ---------------------------------------------------------------------------
01967 inline DocumentHandler* SAXParser::getDocumentHandler()
01968 {
01969     return fDocHandler;
01970 }
01971 
01972 inline const DocumentHandler* SAXParser::getDocumentHandler() const
01973 {
01974     return fDocHandler;
01975 }
01976 
01977 inline EntityResolver* SAXParser::getEntityResolver()
01978 {
01979     return fEntityResolver;
01980 }
01981 
01982 inline const EntityResolver* SAXParser::getEntityResolver() const
01983 {
01984     return fEntityResolver;
01985 }
01986 
01987 inline ErrorHandler* SAXParser::getErrorHandler()
01988 {
01989     return fErrorHandler;
01990 }
01991 
01992 inline const ErrorHandler* SAXParser::getErrorHandler() const
01993 {
01994     return fErrorHandler;
01995 }
01996 
01997 inline const XMLScanner& SAXParser::getScanner() const
01998 {
01999     return *fScanner;
02000 }
02001 
02002 XERCES_CPP_NAMESPACE_END
02003 
02004 #endif


Copyright © 2000 The Apache Software Foundation. All Rights Reserved.