Main Page   Class Hierarchy   Compound List   File List   Compound Members  

XMLScanner.hpp

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: XMLScanner.hpp,v $
00059  * Revision 1.1  2002/05/11 20:19:32  bhavani
00060  * CR#CR062582# adding xercesc 1.7 file
00061  *
00062  * Revision 1.1.1.1  2002/02/01 22:22:03  peiyongz
00063  * sane_include
00064  *
00065  * Revision 1.38  2001/11/30 22:19:15  peiyongz
00066  * cleanUp function made member function
00067  * cleanUp object moved to file scope
00068  *
00069  * Revision 1.37  2001/11/20 18:51:44  tng
00070  * 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).
00071  *
00072  * Revision 1.36  2001/11/13 13:27:28  tng
00073  * Move root element check to XMLScanner.
00074  *
00075  * Revision 1.35  2001/11/02 14:20:14  knoaman
00076  * Add support for identity constraints.
00077  *
00078  * Revision 1.34  2001/10/12 20:52:18  tng
00079  * Schema: Find the attributes see if they should be (un)qualified.
00080  *
00081  * Revision 1.33  2001/09/10 15:16:04  tng
00082  * Store the fGrammarType instead of calling getGrammarType all the time for faster performance.
00083  *
00084  * Revision 1.32  2001/09/10 14:06:22  tng
00085  * Schema: AnyAttribute support in Scanner and Validator.
00086  *
00087  * Revision 1.31  2001/08/13 15:06:39  knoaman
00088  * update <any> validation.
00089  *
00090  * Revision 1.30  2001/08/02 16:54:39  tng
00091  * Reset some Scanner flags in scanReset().
00092  *
00093  * Revision 1.29  2001/08/01 19:11:01  tng
00094  * Add full schema constraint checking flag to the samples and the parser.
00095  *
00096  * Revision 1.28  2001/07/24 21:23:39  tng
00097  * Schema: Use DatatypeValidator for ID/IDREF/ENTITY/ENTITIES/NOTATION.
00098  *
00099  * Revision 1.27  2001/07/13 16:56:48  tng
00100  * ScanId fix.
00101  *
00102  * Revision 1.26  2001/07/12 18:50:17  tng
00103  * Some performance modification regarding standalone check and xml decl check.
00104  *
00105  * Revision 1.25  2001/07/10 21:09:31  tng
00106  * Give proper error messsage when scanning external id.
00107  *
00108  * Revision 1.24  2001/07/09 13:42:08  tng
00109  * Partial Markup in Parameter Entity is validity constraint and thus should be just error, not fatal error.
00110  *
00111  * Revision 1.23  2001/07/05 13:12:11  tng
00112  * Standalone checking is validity constraint and thus should be just error, not fatal error:
00113  *
00114  * Revision 1.22  2001/06/22 12:42:33  tng
00115  * [Bug 2257] 1.5 thinks a <?xml-stylesheet ...> tag is a <?xml ...> tag
00116  *
00117  * Revision 1.21  2001/06/04 20:59:29  jberry
00118  * Add method incrementErrorCount for use by validator. Make sure to reset error count in _both_ the scanReset methods.
00119  *
00120  * Revision 1.20  2001/06/03 19:21:40  jberry
00121  * Add support for tracking error count during parse; enables simple parse without requiring error handler.
00122  *
00123  * Revision 1.19  2001/05/28 20:55:02  tng
00124  * Schema: allocate a fDTDValidator, fSchemaValidator explicitly to avoid wrong cast
00125  *
00126  * Revision 1.18  2001/05/11 15:17:28  tng
00127  * Schema: Nillable fixes.
00128  *
00129  * Revision 1.17  2001/05/11 13:26:17  tng
00130  * Copyright update.
00131  *
00132  * Revision 1.16  2001/05/03 20:34:29  tng
00133  * Schema: SchemaValidator update
00134  *
00135  * Revision 1.15  2001/05/03 19:09:09  knoaman
00136  * Support Warning/Error/FatalError messaging.
00137  * Validity constraints errors are treated as errors, with the ability by user to set
00138  * validity constraints as fatal errors.
00139  *
00140  * Revision 1.14  2001/04/19 18:16:59  tng
00141  * Schema: SchemaValidator update, and use QName in Content Model
00142  *
00143  * Revision 1.13  2001/03/30 16:46:56  tng
00144  * Schema: Use setDoSchema instead of setSchemaValidation which makes more sense.
00145  *
00146  * Revision 1.12  2001/03/30 16:35:06  tng
00147  * Schema: Whitespace normalization.
00148  *
00149  * Revision 1.11  2001/03/21 21:56:05  tng
00150  * Schema: Add Schema Grammar, Schema Validator, and split the DTDValidator into DTDValidator, DTDScanner, and DTDGrammar.
00151  *
00152  * Revision 1.10  2001/02/15 15:56:27  tng
00153  * Schema: Add setSchemaValidation and getSchemaValidation for DOMParser and SAXParser.
00154  * Add feature "http://apache.org/xml/features/validation/schema" for SAX2XMLReader.
00155  * New data field  fSchemaValidation in XMLScanner as the flag.
00156  *
00157  * Revision 1.9  2000/04/12 22:58:28  roddey
00158  * Added support for 'auto validate' mode.
00159  *
00160  * Revision 1.8  2000/03/03 01:29:32  roddey
00161  * Added a scanReset()/parseReset() method to the scanner and
00162  * parsers, to allow for reset after early exit from a progressive parse.
00163  * Added calls to new Terminate() call to all of the samples. Improved
00164  * documentation in SAX and DOM parsers.
00165  *
00166  * Revision 1.7  2000/03/02 19:54:30  roddey
00167  * This checkin includes many changes done while waiting for the
00168  * 1.1.0 code to be finished. I can't list them all here, but a list is
00169  * available elsewhere.
00170  *
00171  * Revision 1.6  2000/02/24 20:18:07  abagchi
00172  * Swat for removing Log from API docs
00173  *
00174  * Revision 1.5  2000/02/06 07:47:54  rahulj
00175  * Year 2K copyright swat.
00176  *
00177  * Revision 1.4  2000/01/24 20:40:43  roddey
00178  * Exposed the APIs to get to the byte offset in the source XML buffer. This stuff
00179  * is not tested yet, but I wanted to get the API changes in now so that the API
00180  * can be stablized.
00181  *
00182  * Revision 1.3  2000/01/12 23:52:46  roddey
00183  * These are trivial changes required to get the C++ and Java versions
00184  * of error messages more into sync. Mostly it was where the Java version
00185  * was passing out one or more parameter than the C++ version was. In
00186  * some cases the change just required an extra parameter to get the
00187  * needed info to the place where the error was issued.
00188  *
00189  * Revision 1.2  2000/01/12 00:15:04  roddey
00190  * Changes to deal with multiply nested, relative pathed, entities and to deal
00191  * with the new URL class changes.
00192  *
00193  * Revision 1.1.1.1  1999/11/09 01:08:23  twl
00194  * Initial checkin
00195  *
00196  * Revision 1.4  1999/11/08 20:44:52  rahul
00197  * Swat for adding in Product name and CVS comment log variable.
00198  *
00199  */
00200 
00201 
00202 #if !defined(XMLSCANNER_HPP)
00203 #define XMLSCANNER_HPP
00204 
00205 #include <xercesc/util/KVStringPair.hpp>
00206 #include <xercesc/util/RefVectorOf.hpp>
00207 #include <xercesc/util/XMLString.hpp>
00208 #include <xercesc/framework/XMLAttr.hpp>
00209 #include <xercesc/framework/XMLBufferMgr.hpp>
00210 #include <xercesc/framework/XMLErrorCodes.hpp>
00211 #include <xercesc/framework/XMLRefInfo.hpp>
00212 #include <xercesc/framework/XMLPScanToken.hpp>
00213 #include <xercesc/internal/ElemStack.hpp>
00214 #include <xercesc/internal/ReaderMgr.hpp>
00215 #include <xercesc/validators/DTD/DTDEntityDecl.hpp>
00216 #include <xercesc/validators/DTD/DTDValidator.hpp>
00217 #include <xercesc/validators/schema/SchemaValidator.hpp>
00218 
00219 class InputSource;
00220 class XMLDocumentHandler;
00221 class DocTypeHandler;
00222 class XMLElementDecl;
00223 class XMLEntityHandler;
00224 class EntityResolver;
00225 class XMLErrorReporter;
00226 class ErrorHandler;
00227 class XMLMsgLoader;
00228 class XMLValidator;
00229 class ValueStoreCache;
00230 class XPathMatcherStack;
00231 class FieldActivator;
00232 class IdentityConstraint;
00233 
00234 //
00235 //  This is the mondo scanner class, which does the vast majority of the
00236 //  work of parsing. It handles reading in input and spitting out events
00237 //  to installed handlers.
00238 //
00239 class XMLPARSER_EXPORT XMLScanner
00240 {
00241 public :
00242     // -----------------------------------------------------------------------
00243     //  Public class types
00244     //
00245     //  NOTE: These should really be private, but some of the compilers we
00246     //  have to deal with are too stupid to understand this.
00247     //
00248     //  DeclTypes
00249     //      Used by scanXMLDecl() to know what type of decl it should scan.
00250     //      Text decls have slightly different rules from XMLDecls.
00251     //
00252     //  EntityExpRes
00253     //      These are the values returned from the entity expansion method,
00254     //      to indicate how it went.
00255     //
00256     //  XMLTokens
00257     //      These represent the possible types of input we can get while
00258     //      scanning content.
00259     //
00260     //  ValScheme
00261     //      This indicates what the scanner should do in terms of validation.
00262     //      'Auto' means if there is any int/ext subset, then validate. Else,
00263     //      don't.
00264     // -----------------------------------------------------------------------
00265     enum DeclTypes
00266     {
00267         Decl_Text
00268         , Decl_XML
00269     };
00270 
00271     enum EntityExpRes
00272     {
00273         EntityExp_Pushed
00274         , EntityExp_Returned
00275         , EntityExp_Failed
00276     };
00277 
00278     enum XMLTokens
00279     {
00280         Token_CData
00281         , Token_CharData
00282         , Token_Comment
00283         , Token_EndTag
00284         , Token_EOF
00285         , Token_PI
00286         , Token_StartTag
00287         , Token_Unknown
00288     };
00289 
00290     enum ValSchemes
00291     {
00292         Val_Never
00293         , Val_Always
00294         , Val_Auto
00295     };
00296 
00297 
00298     // -----------------------------------------------------------------------
00299     //  Constructors and Destructor
00300     // -----------------------------------------------------------------------
00301     XMLScanner
00302     (
00303         XMLValidator* const valToAdopt
00304     );
00305     XMLScanner
00306     (
00307         XMLDocumentHandler* const  docHandler
00308         , DocTypeHandler* const    docTypeHandler
00309         , XMLEntityHandler* const  entityHandler
00310         , XMLErrorReporter* const  errReporter
00311         , XMLValidator* const      valToAdopt
00312     );
00313     ~XMLScanner();
00314 
00315 
00316     // -----------------------------------------------------------------------
00317     //  Error emitter methods
00318     // -----------------------------------------------------------------------
00319     void emitError(const XMLErrs::Codes toEmit);
00320     void emitError
00321     (
00322         const   XMLErrs::Codes    toEmit
00323         , const XMLCh* const        text1
00324         , const XMLCh* const        text2 = 0
00325         , const XMLCh* const        text3 = 0
00326         , const XMLCh* const        text4 = 0
00327     );
00328     void emitError
00329     (
00330         const   XMLErrs::Codes    toEmit
00331         , const char* const         text1
00332         , const char* const         text2 = 0
00333         , const char* const         text3 = 0
00334         , const char* const         text4 = 0
00335     );
00336 
00337 
00338     // -----------------------------------------------------------------------
00339     //  Getter methods
00340     // -----------------------------------------------------------------------
00341     const XMLDocumentHandler* getDocHandler() const;
00342     XMLDocumentHandler* getDocHandler();
00343     const DocTypeHandler* getDocTypeHandler() const;
00344     DocTypeHandler* getDocTypeHandler();
00345     bool getDoNamespaces() const;
00346     ValSchemes getValidationScheme() const;
00347     bool getDoSchema() const;
00348     bool getValidationSchemaFullChecking() const;
00349     const XMLEntityHandler* getEntityHandler() const;
00350     XMLEntityHandler* getEntityHandler();
00351     const XMLErrorReporter* getErrorReporter() const;
00352     XMLErrorReporter* getErrorReporter();
00353     bool getExitOnFirstFatal() const;
00354     bool getValidationConstraintFatal() const;
00355     RefHashTableOf<XMLRefInfo>* getIDRefList();
00356     const RefHashTableOf<XMLRefInfo>* getIDRefList() const;
00357     bool getInException() const;
00358     bool getLastExtLocation
00359     (
00360                 XMLCh* const    sysIdToFill
00361         , const unsigned int    maxSysIdChars
00362         ,       XMLCh* const    pubIdToFill
00363         , const unsigned int    maxPubIdChars
00364         ,       unsigned int&   lineToFill
00365         ,       unsigned int&   colToFill
00366     );
00367     const Locator* getLocator() const;
00368     unsigned int getSrcOffset() const;
00369     bool getStandalone() const;
00370     const XMLValidator* getValidator() const;
00371     XMLValidator* getValidator();
00372     int getErrorCount();
00373     const DTDEntityDecl* getEntityDecl
00374     (
00375         const   XMLCh* const    entName
00376     )   const;
00377 
00378     DTDEntityDecl* getEntityDecl
00379     (
00380         const   XMLCh* const    entName
00381     );
00382     NameIdPoolEnumerator<DTDEntityDecl> getEntityEnumerator() const;
00383     NameIdPool<DTDEntityDecl>* getEntityDeclPool();
00384     const NameIdPool<DTDEntityDecl>* getEntityDeclPool() const;
00385     const XMLStringPool* getURIStringPool() const;
00386     XMLStringPool* getURIStringPool();
00387     bool getHasNoDTD() const;
00388     XMLCh* getExternalSchemaLocation() const;
00389     XMLCh* getExternalNoNamespaceSchemaLocation() const;
00390     bool getURLEntityCaching() const;
00391     XMLCh* getURLEntityCacheDir() const;
00392 
00393     // -----------------------------------------------------------------------
00394     //  Getter methods
00395     // -----------------------------------------------------------------------
00396 
00405     unsigned int getEmptyNamespaceId() const;
00406 
00416     unsigned int getUnknownNamespaceId() const;
00417 
00425     unsigned int getXMLNamespaceId() const;
00426 
00434     unsigned int getXMLNSNamespaceId() const;
00435 
00440     bool getURIText
00441     (
00442         const   unsigned int    uriId
00443         ,       XMLBuffer&      uriBufToFill
00444     )   const;
00445 
00446     const XMLCh* getURIText(const   unsigned int    uriId) const;
00447 
00455     unsigned int resolveQName
00456     (
00457         const   XMLCh* const        qName
00458         ,       XMLBuffer&          nameBufToFill
00459         ,       XMLBuffer&          prefixBufToFill
00460         , const ElemStack::MapModes mode
00461     );
00462 
00463     /* tell if the validator comes from user */
00464     bool isValidatorFromUser();
00465 
00466 
00467     // -----------------------------------------------------------------------
00468     //  Setter methods
00469     // -----------------------------------------------------------------------
00470     void setDocHandler(XMLDocumentHandler* const docHandler);
00471     void setDocTypeHandler(DocTypeHandler* const docTypeHandler);
00472     void setDoNamespaces(const bool doNamespaces);
00473     void setEntityHandler(XMLEntityHandler* const docTypeHandler);
00474     void setEntityResolver(EntityResolver* const handler);
00475     void setErrorReporter(XMLErrorReporter* const errHandler);
00476     void setErrorHandler(ErrorHandler* const handler);
00477     void setExitOnFirstFatal(const bool newValue);
00478     void setValidationConstraintFatal(const bool newValue);
00479     void setValidationScheme(const ValSchemes newScheme);
00480     void setValidator(XMLValidator* const valToAdopt);
00481     void setDoSchema(const bool doSchema);
00482     void setValidationSchemaFullChecking(const bool schemaFullChecking);
00483     void setHasNoDTD(const bool hasNoDTD);
00484     void setRootElemName(XMLCh* rootElemName);
00485     void setExternalSchemaLocation(const XMLCh* const schemaLocation);
00486     void setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation);
00487     void setExternalSchemaLocation(const char* const schemaLocation);
00488     void setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation);
00489     void setURLEntityCaching(const bool useCache);
00490     void setURLEntityCacheDir(const XMLCh* const cacheDir);
00491     void setURLEntityCacheDir(const char* const cacheDir);
00492     void setURLSetByAPI(const bool setByAPI);
00493 
00494     // -----------------------------------------------------------------------
00495     //  Mutator methods
00496     // -----------------------------------------------------------------------
00497     void incrementErrorCount(void);                     // For use by XMLValidator
00498 
00499     // -----------------------------------------------------------------------
00500     //  Deprecated methods as of 3.2.0. Use getValidationScheme() and
00501     //  setValidationScheme() instead.
00502     // -----------------------------------------------------------------------
00503     bool getDoValidation() const;
00504     void setDoValidation(const bool validate, const bool setValScheme = true);
00505 
00506     // -----------------------------------------------------------------------
00507     // checkEnvForCaching() checks the environment variables URLENTITYCACHING
00508     // and URLENTITYCACHEDIR to see if caching it set. If it already set
00509     // programmatically, this function ignores theses variables.
00510     // -----------------------------------------------------------------------
00511     void checkEnvForCaching();
00512 
00513     // -----------------------------------------------------------------------
00514     //  Document scanning methods
00515     //
00516     //  scanDocument() does the entire source document. scanFirst(),
00517     //  scanNext(), and scanReset() support a progressive parse.
00518     // -----------------------------------------------------------------------
00519     void scanDocument
00520     (
00521         const   InputSource&    src
00522         , const bool            reuseGrammar = false
00523     );
00524     void scanDocument
00525     (
00526         const   XMLCh* const    systemId
00527         , const bool            reuseGrammar = false
00528     );
00529     void scanDocument
00530     (
00531         const   char* const     systemId
00532         , const bool            reuseGrammar = false
00533     );
00534 
00535     bool scanFirst
00536     (
00537         const   InputSource&    src
00538         ,       XMLPScanToken&  toFill
00539         , const bool            reuseGrammar = false
00540     );
00541     bool scanFirst
00542     (
00543         const   XMLCh* const    systemId
00544         ,       XMLPScanToken&  toFill
00545         , const bool            reuseGrammar = false
00546     );
00547     bool scanFirst
00548     (
00549         const   char* const     systemId
00550         ,       XMLPScanToken&  toFill
00551         , const bool            reuseGrammar = false
00552     );
00553 
00554     bool scanNext(XMLPScanToken& toFill);
00555 
00556     void scanReset(XMLPScanToken& toFill);
00557 
00558     bool checkXMLDecl(bool startWithAngle);
00559 
00560     // -----------------------------------------------------------------------
00561     //  Notification that lazy data has been deleted
00562     // -----------------------------------------------------------------------
00563         static void reinitScannerMutex();
00564 
00565         static void reinitMsgLoader();
00566 
00567 private :
00568     // -----------------------------------------------------------------------
00569     //  Unimplemented constructors and operators
00570     // -----------------------------------------------------------------------
00571     XMLScanner();
00572     XMLScanner(const XMLScanner&);
00573     void operator=(const XMLScanner&);
00574 
00575 
00576     // -----------------------------------------------------------------------
00577     //  Private helper methods
00578     // -----------------------------------------------------------------------
00579     void commonInit();
00580     void initValidator(XMLValidator* theValidator);
00581     void resetEntityDeclPool();
00582     void resetURIStringPool();
00583 
00584 
00585     // -----------------------------------------------------------------------
00586     //  Private helper methods
00587     //
00588     //  These are implemented in XMLScanner2.cpp, to keep the main file from
00589     //  becoming so bloated. We can't have any bloated files.
00590     // -----------------------------------------------------------------------
00591     unsigned int buildAttList
00592     (
00593         const   RefVectorOf<KVStringPair>&  providedAttrs
00594         , const unsigned int                attCount
00595         ,       XMLElementDecl*             elemDecl
00596         ,       RefVectorOf<XMLAttr>&       toFill
00597     );
00598     void checkIDRefs();
00599     bool isLegalToken(const XMLPScanToken& toCheck);
00600     bool normalizeAttValue
00601     (
00602         const   XMLAttDef* const    attDef
00603         , const XMLCh* const        value
00604         ,       XMLBuffer&          toFill
00605     );
00606     bool normalizeAttRawValue
00607     (
00608         const   XMLCh* const        attrName
00609         , const XMLCh* const        value
00610         ,       XMLBuffer&          toFill
00611     );
00612 
00613     unsigned int resolvePrefix
00614     (
00615         const   XMLCh* const        prefix
00616         , const ElemStack::MapModes mode
00617     );
00618     unsigned int resolvePrefix
00619     (
00620         const   XMLCh* const        prefix
00621         ,       XMLBuffer&          uriBufToFill
00622         , const ElemStack::MapModes mode
00623     );
00624     void scanReset(const InputSource& src);
00625     void sendCharData(XMLBuffer& toSend);
00626     XMLTokens senseNextToken(unsigned int& orgReader);
00627     void updateNSMap
00628     (
00629         const   XMLCh* const    attrName
00630         , const XMLCh* const    attrValue
00631     );
00632     void scanRawAttrListforNameSpaces(const RefVectorOf<KVStringPair>* theRawAttrList, int attCount);
00633     void parseSchemaLocation(const XMLCh* const schemaLocationStr);
00634     void resolveSchemaGrammar(const XMLCh* const loc, const XMLCh* const uri);
00635     bool switchGrammar(unsigned int newGrammarNameSpaceIndex);
00636     bool switchGrammar(const XMLCh* const newGrammarNameSpace);
00637     bool laxElementValidation(QName* element, ContentLeafNameTypeVector* cv,
00638                               const XMLContentModel* const cm,
00639                               const unsigned int parentElemDepth);
00640     bool anyAttributeValidation(SchemaAttDef* attWildCard,
00641                                 unsigned int uriId,
00642                                 bool& skipThisOne,
00643                                 bool& laxThisOne);
00644 
00645     // -----------------------------------------------------------------------
00646     //  Private scanning methods
00647     // -----------------------------------------------------------------------
00648     bool basicAttrValueScan
00649     (
00650         const   XMLCh* const    attrName
00651         ,       XMLBuffer&      toFill
00652     );
00653     bool getQuotedString(XMLBuffer& toFill);
00654     unsigned int rawAttrScan
00655     (
00656         const   XMLCh* const                elemName
00657         ,       RefVectorOf<KVStringPair>&  toFill
00658         ,       bool&                       isEmpty
00659     );
00660     bool scanAttValue
00661     (
00662         const   XMLAttDef* const    attDef
00663         ,       XMLBuffer&          toFill
00664     );
00665     void scanCDSection();
00666     void scanCharData(XMLBuffer& toToUse);
00667     bool scanCharRef(XMLCh& toFill, XMLCh& second);
00668     void scanComment();
00669     bool scanContent(const bool extEntity);
00670     void scanEndTag(bool& gotData);
00671     EntityExpRes scanEntityRef
00672     (
00673         const   bool    inAttVal
00674         ,       XMLCh&  firstCh
00675         ,       XMLCh&  secondCh
00676         ,       bool&   escaped
00677     );
00678     bool scanEq();
00679     void scanMiscellaneous();
00680     void scanPI();
00681     void scanProlog();
00682     bool scanStartTag(bool& gotData);
00683     bool scanStartTagNS(bool& gotData);
00684     void scanXMLDecl(const DeclTypes type);
00685     unsigned int scanUpToWSOr
00686     (
00687                 XMLBuffer&  toFill
00688         , const XMLCh       chEndChar
00689     );
00690 
00691     // -----------------------------------------------------------------------
00692     //  Private helper methods
00693     // -----------------------------------------------------------------------
00694     void resizeElemState();
00695 
00696     // -----------------------------------------------------------------------
00697     //  IdentityConstraints Activation methods
00698     // -----------------------------------------------------------------------
00699     void activateSelectorFor(IdentityConstraint* const ic);
00700 
00701     // -----------------------------------------------------------------------
00702     //  Data members
00703     //
00704     //  fAttrList
00705     //      Every time we get a new element start tag, we have to pass to
00706     //      the document handler the attributes found. To make it more
00707     //      efficient we keep this ref vector of XMLAttr objects around. We
00708     //      just reuse it over and over, allowing it to grow to meet the
00709     //      peek need.
00710     //
00711     //  fBufMgr
00712     //      This is a manager for temporary buffers used during scanning.
00713     //      For efficiency we must use a set of static buffers, but we have
00714     //      to insure that they are not incorrectly reused. So this manager
00715     //      provides the smarts to hand out buffers as required.
00716     //
00717     //  fDocHandler
00718     //      The client code's document handler. If zero, then no document
00719     //      handler callouts are done. We don't adopt it.
00720     //
00721     //  fDocTypeHandler
00722     //      The client code's document type handler (used by DTD Validator).
00723     //
00724     //  fDoNamespaces
00725     //      This flag indicates whether the client code wants us to do
00726     //      namespaces or not. If the installed validator indicates that it
00727     //      has to do namespaces, then this is ignored.
00728     //
00729     //  fElemStack
00730     //      This is the element stack that is used to track the elements that
00731     //      are currently being worked on.
00732     //
00733     //  fEntityHandler
00734     //      The client code's entity handler. If zero, then no entity handler
00735     //      callouts are done. We don't adopt it.
00736     //
00737     //  fEntityResolver
00738     //      The client code's entity resolver.  Need to store this info for
00739     //      Schema parse entity resolving.
00740     //
00741     //  fErrorReporter
00742     //      The client code's error reporter. If zero, then no error reporter
00743     //      callouts are done. We don't adopt it.
00744     //
00745     //  fErrorHandler
00746     //      The client code's error handler.  Need to store this info for
00747     //      Schema parse error handling.
00748     //
00749     //  fExitOnFirstFatal
00750     //      This indicates whether we bail out on the first fatal XML error
00751     //      or not. It defaults to true, which is the strict XML way, but it
00752     //      can be changed.
00753     //
00754     //  fValidationConstraintFatal
00755     //      This indicates whether we treat validation constraint errors as
00756     //      fatal errors or not. It defaults to false, but it can be changed.
00757     //
00758     //  fIDRefList
00759     //      This is a list of XMLRefInfo objects. This member lets us do all
00760     //      needed ID-IDREF balancing checks.
00761     //
00762     //  fInException
00763     //      To avoid a circular freakout when we catch an exception and emit
00764     //      it, which would normally throw again if the 'fail on first error'
00765     //      flag is one.
00766     //
00767     //  fRawAttrList
00768     //      During the initial scan of the attributes we can only do a raw
00769     //      scan for key/value pairs. So this vector is used to store them
00770     //      until they can be processed (and put into fAttrList.)
00771     //
00772     //  fReaderMgr
00773     //      This is the reader manager, from which we get characters. It
00774     //      manages the reader stack for us, and provides a lot of convenience
00775     //      methods to do specialized checking for chars, sequences of chars,
00776     //      skipping chars, etc...
00777     //
00778     //  fReuseGrammar
00779     //      This flag is set on a per-scan basis. So its provided in the
00780     //      scanDocument() and scanFirst() methods, and applies for that
00781     //      one pass. It indicates if the Grammar should be reused or not.
00782     //      If so, then all the Grammar will be ignored.
00783     //      There cannot be any internal subset.
00784     //
00785     //  fScannerId
00786     //  fSequenceId
00787     //      These are used for progressive parsing, to make sure that the
00788     //      client code does the right thing at the right time.
00789     //
00790     //  fStandalone
00791     //      Indicates whether the document is standalone or not. Defaults to
00792     //      no, but can be overridden in the XMLDecl.
00793     //
00794     //  fHasNoDTD
00795     //      Indicates the document has no DTD or has only an internal DTD subset
00796     //      which contains no parameter entity references.
00797     //
00798     //  fValidate
00799     //      Indicates whether any validation should be done. This is defined
00800     //      by the existence of a Grammar together with fValScheme.
00801     //
00802     //  fValidator
00803     //      The installed validator. We look at them via the abstract
00804     //      validator interface, and don't know what it actual is.
00805     //      Either point to user's installed validator, or fDTDValidator
00806     //      or fSchemaValidator.
00807     //
00808     //  fDTDValidator
00809     //      The DTD validator instance.
00810     //
00811     //  fSchemaValidator
00812     //      The Schema validator instance.
00813     //
00814     //  fValidatorFromUser
00815     //      This flag indicates whether the validator was installed from
00816     //      user.  If false, then the validator was created by the Scanner.
00817     //
00818     //  fValScheme
00819     //      This is the currently set validation scheme. It defaults to
00820     //      'never', but can be set by the client.
00821     //
00822     //  fErrorCount
00823     //          The number of errors we've encountered.
00824     //
00825     //  fDoSchema
00826     //      This flag indicates whether the client code wants Schema to
00827     //      be processed or not.
00828     //
00829     //  fSchemaFullChecking
00830     //      This flag indicates whether the client code wants full Schema
00831     //      constraint checking.
00832     //
00833     //  fSeeXsi
00834     //      This flag indicates a schema has been seen.
00835     //
00836     //  fAttName
00837     //  fAttValue
00838     //  fCDataBuf
00839     //  fNameBuf
00840     //  fQNameBuf
00841     //  fPrefixBuf
00842     //      For the most part, buffers are obtained from the fBufMgr object
00843     //      on the fly. However, for the start tag scan, we have a set of
00844     //      fixed buffers for performance reasons. These are used a lot and
00845     //      there are a number of them, so asking the buffer manager each
00846     //      time for new buffers is a bit too much overhead.
00847     //
00848     //  fEmptyNamespaceId
00849     //      This is the id of the empty namespace URI. This is a special one
00850     //      because of the xmlns="" type of deal. We have to quickly sense
00851     //      that its the empty namespace.
00852     //
00853     //  fUnknownNamespaceId
00854     //      This is the id of the namespace URI which is assigned to the
00855     //      global namespace. Its for debug purposes only, since there is no
00856     //      real global namespace URI. Its set by the derived class.
00857     //
00858     //  fXMLNamespaceId
00859     //  fXMLNSNamespaceId
00860     //      These are the ids of the namespace URIs which are assigned to the
00861     //      'xml' and 'xmlns' special prefixes. The former is officially
00862     //      defined but the latter is not, so we just provide one for debug
00863     //      purposes.
00864     //
00865     //  fSchemaNamespaceId
00866     //      This is the id of the schema namespace URI.
00867     //
00868     //  fElemState
00869     //  fElemStateSize
00870     //      Stores an element next state from DFA content model - used for
00871     //      wildcard validation
00872     //
00873     //  fGrammarResolver
00874     //      Grammar Pool that stores all the Grammar
00875     //
00876     //  fGrammar
00877     //      Current Grammar used by the Scanner and Validator
00878     //
00879     //  fGrammarType
00880     //      Current Grammar Type.  Store this value instead of calling getGrammarType
00881     //      all the time for faster performance.
00882     //
00883     //  fEntityDeclPool
00884     //      This is a pool of EntityDecl objects, which contains all of the
00885     //      general entities that are declared in the DTD subsets, plus the
00886     //      default entities (such as &gt; &lt; ...) defined by the XML Standard.
00887     //
00888     //  fURIStringPool
00889     //      This is a pool for URIs with unique ids assigned. We use a standard
00890     //      string pool class.  This pool is going to be shared by all Grammar.
00891     //      Use only if namespace is turned on.
00892     //
00893     //  fMatcherStack
00894     //      Stack of active XPath matchers for identity constraints. All
00895     //      active XPath matchers are notified of startElement, characters
00896     //      and endElement callbacks in order to perform their matches.
00897     //
00898     //  fValueStoreCache
00899     //      Cache of value stores for identity constraint fields.
00900     //
00901     //  fFieldActivator
00902     //      Activates fields within a certain scope when a selector matches
00903     //      its xpath.
00904     //
00905     //  fRootElemName
00906     //      No matter we are using DTD or Schema Grammar, if a DOCTYPE exists,
00907     //      we need to verify the root element name.  So store the rootElement
00908     //      that is used in the DOCTYPE in the Scanner instead of in the DTDGrammar
00909     //      where it used to
00910     //
00911     //  fExternalSchemaLocation
00912     //      The list of Namespace/SchemaLocation that was specified externally
00913     //      using setExternalSchemaLocation.
00914     //
00915     //  fExternalNoNamespaceSchemaLocation
00916     //      The no target namespace XML Schema Location that was specified
00917     //      externally using setExternalNoNamespaceSchemaLocation.
00918     //
00919     //  fURLEntityCaching
00920     //      This flag indicates if the external entities should be
00921     //      cached or not.
00922     //
00923     //  fURLEntityCacheDir
00924     //      The location where the external entities are cached.
00925     //
00926     //  fURLSetByAPI
00927     //      Flag to indicate if fURLEntityCaching was set programmatically.
00928     //      Setting it in the program takes precedence over setting it
00929     //      using the environment variable.
00930     //
00931     // -----------------------------------------------------------------------
00932     bool                        fDoNamespaces;
00933     bool                        fExitOnFirstFatal;
00934     bool                        fValidationConstraintFatal;
00935     bool                        fInException;
00936     bool                        fReuseGrammar;
00937     bool                        fStandalone;
00938     bool                        fHasNoDTD;
00939     bool                        fValidate;
00940     bool                        fValidatorFromUser;
00941     bool                        fDoSchema;
00942     bool                        fSchemaFullChecking;
00943     bool                        fSeeXsi;
00944     int                         fErrorCount;
00945     unsigned int                fEmptyNamespaceId;
00946     unsigned int                fUnknownNamespaceId;
00947     unsigned int                fXMLNamespaceId;
00948     unsigned int                fXMLNSNamespaceId;
00949     unsigned int                fSchemaNamespaceId;
00950     unsigned int                fElemStateSize;
00951     XMLUInt32                   fScannerId;
00952     XMLUInt32                   fSequenceId;
00953     unsigned int*               fElemState;
00954     RefVectorOf<XMLAttr>*       fAttrList;
00955     XMLBufferMgr                fBufMgr;
00956     XMLDocumentHandler*         fDocHandler;
00957     DocTypeHandler*             fDocTypeHandler;
00958     ElemStack                   fElemStack;
00959     XMLEntityHandler*           fEntityHandler;
00960     EntityResolver*             fEntityResolver;
00961     XMLErrorReporter*           fErrorReporter;
00962     ErrorHandler*               fErrorHandler;
00963     RefHashTableOf<XMLRefInfo>* fIDRefList;
00964     RefVectorOf<KVStringPair>*  fRawAttrList;
00965     ReaderMgr                   fReaderMgr;
00966     XMLValidator*               fValidator;
00967     DTDValidator*               fDTDValidator;
00968     SchemaValidator*            fSchemaValidator;
00969     ValSchemes                  fValScheme;
00970     XMLBuffer                   fAttNameBuf;
00971     XMLBuffer                   fAttValueBuf;
00972     XMLBuffer                   fCDataBuf;
00973     XMLBuffer                   fNameBuf;
00974     XMLBuffer                   fQNameBuf;
00975     XMLBuffer                   fPrefixBuf;
00976     XMLBuffer                   fURIBuf;
00977     GrammarResolver*            fGrammarResolver;
00978     Grammar*                    fGrammar;
00979     Grammar::GrammarType        fGrammarType;
00980     NameIdPool<DTDEntityDecl>*  fEntityDeclPool;
00981     XMLStringPool*              fURIStringPool;
00982     XPathMatcherStack*          fMatcherStack;
00983     ValueStoreCache*            fValueStoreCache;
00984     FieldActivator*             fFieldActivator;
00985     XMLCh*                      fRootElemName;
00986     XMLCh*                      fExternalSchemaLocation;
00987     XMLCh*                      fExternalNoNamespaceSchemaLocation;
00988     bool                        fURLEntityCaching;
00989     XMLCh*                      fURLEntityCacheDir;
00990     bool                        fURLSetByAPI;
00991 };
00992 
00993 
00994 
00995 // ---------------------------------------------------------------------------
00996 //  XMLScanner: Getter methods
00997 // ---------------------------------------------------------------------------
00998 inline const XMLDocumentHandler* XMLScanner::getDocHandler() const
00999 {
01000     return fDocHandler;
01001 }
01002 
01003 inline XMLDocumentHandler* XMLScanner::getDocHandler()
01004 {
01005     return fDocHandler;
01006 }
01007 
01008 inline const DocTypeHandler* XMLScanner::getDocTypeHandler() const
01009 {
01010     return fDocTypeHandler;
01011 }
01012 
01013 inline DocTypeHandler* XMLScanner::getDocTypeHandler()
01014 {
01015     return fDocTypeHandler;
01016 }
01017 
01018 inline bool XMLScanner::getDoNamespaces() const
01019 {
01020     return fDoNamespaces;
01021 }
01022 
01023 inline const XMLEntityHandler* XMLScanner::getEntityHandler() const
01024 {
01025     return fEntityHandler;
01026 }
01027 
01028 inline XMLEntityHandler* XMLScanner::getEntityHandler()
01029 {
01030     return fEntityHandler;
01031 }
01032 
01033 inline const XMLErrorReporter* XMLScanner::getErrorReporter() const
01034 {
01035     return fErrorReporter;
01036 }
01037 
01038 inline XMLErrorReporter* XMLScanner::getErrorReporter()
01039 {
01040     return fErrorReporter;
01041 }
01042 
01043 inline bool XMLScanner::getExitOnFirstFatal() const
01044 {
01045     return fExitOnFirstFatal;
01046 }
01047 
01048 inline bool XMLScanner::getValidationConstraintFatal() const
01049 {
01050     return fValidationConstraintFatal;
01051 }
01052 
01053 inline RefHashTableOf<XMLRefInfo>* XMLScanner::getIDRefList()
01054 {
01055     return fIDRefList;
01056 }
01057 
01058 inline bool XMLScanner::getInException() const
01059 {
01060     return fInException;
01061 }
01062 
01063 inline const RefHashTableOf<XMLRefInfo>* XMLScanner::getIDRefList() const
01064 {
01065     return fIDRefList;
01066 }
01067 
01068 inline const Locator* XMLScanner::getLocator() const
01069 {
01070     return &fReaderMgr;
01071 }
01072 
01073 inline unsigned int XMLScanner::getSrcOffset() const
01074 {
01075     return fReaderMgr.getSrcOffset();
01076 }
01077 
01078 inline bool XMLScanner::getStandalone() const
01079 {
01080     return fStandalone;
01081 }
01082 
01083 inline XMLScanner::ValSchemes XMLScanner::getValidationScheme() const
01084 {
01085     return fValScheme;
01086 }
01087 
01088 inline const XMLValidator* XMLScanner::getValidator() const
01089 {
01090     return fValidator;
01091 }
01092 
01093 inline XMLValidator* XMLScanner::getValidator()
01094 {
01095     return fValidator;
01096 }
01097 
01098 inline bool XMLScanner::getDoSchema() const
01099 {
01100     return fDoSchema;
01101 }
01102 
01103 inline bool XMLScanner::getValidationSchemaFullChecking() const
01104 {
01105     return fSchemaFullChecking;
01106 }
01107 
01108 inline int XMLScanner::getErrorCount()
01109 {
01110     return fErrorCount;
01111 }
01112 
01113 inline bool XMLScanner::isValidatorFromUser()
01114 {
01115     return fValidatorFromUser;
01116 }
01117 
01118 inline unsigned int XMLScanner::getEmptyNamespaceId() const
01119 {
01120     return fEmptyNamespaceId;
01121 }
01122 
01123 inline unsigned int XMLScanner::getUnknownNamespaceId() const
01124 {
01125     return fUnknownNamespaceId;
01126 }
01127 
01128 inline unsigned int XMLScanner::getXMLNamespaceId() const
01129 {
01130     return fXMLNamespaceId;
01131 }
01132 
01133 inline unsigned int XMLScanner::getXMLNSNamespaceId() const
01134 {
01135     return fXMLNSNamespaceId;
01136 }
01137 
01138 inline NameIdPoolEnumerator<DTDEntityDecl>
01139 XMLScanner::getEntityEnumerator() const
01140 {
01141     return NameIdPoolEnumerator<DTDEntityDecl>(fEntityDeclPool);
01142 }
01143 
01144 inline const DTDEntityDecl* XMLScanner::getEntityDecl(const  XMLCh* const    entName) const
01145 {
01146     return fEntityDeclPool->getByKey(entName);
01147 }
01148 
01149 inline DTDEntityDecl* XMLScanner::getEntityDecl(const XMLCh* const entName)
01150 {
01151     return fEntityDeclPool->getByKey(entName);
01152 }
01153 
01154 inline NameIdPool<DTDEntityDecl>* XMLScanner::getEntityDeclPool()
01155 {
01156     return fEntityDeclPool;
01157 }
01158 
01159 inline const NameIdPool<DTDEntityDecl>* XMLScanner::getEntityDeclPool() const
01160 {
01161     return fEntityDeclPool;
01162 }
01163 
01164 inline const XMLStringPool* XMLScanner::getURIStringPool() const
01165 {
01166     return fURIStringPool;
01167 }
01168 
01169 inline XMLStringPool* XMLScanner::getURIStringPool()
01170 {
01171     return fURIStringPool;
01172 }
01173 
01174 inline bool XMLScanner::getHasNoDTD() const
01175 {
01176     return fHasNoDTD;
01177 }
01178 
01179 inline XMLCh* XMLScanner::getExternalSchemaLocation() const
01180 {
01181     return fExternalSchemaLocation;
01182 }
01183 
01184 inline XMLCh* XMLScanner::getExternalNoNamespaceSchemaLocation() const
01185 {
01186     return fExternalNoNamespaceSchemaLocation;
01187 }
01188 
01189 inline bool XMLScanner::getURLEntityCaching() const
01190 {
01191     return fURLEntityCaching;
01192 }
01193 
01194 inline XMLCh* XMLScanner::getURLEntityCacheDir() const
01195 {
01196     return fURLEntityCacheDir;
01197 }
01198 
01199 // ---------------------------------------------------------------------------
01200 //  XMLScanner: Setter methods
01201 // ---------------------------------------------------------------------------
01202 inline void XMLScanner::setDocHandler(XMLDocumentHandler* const docHandler)
01203 {
01204     fDocHandler = docHandler;
01205 }
01206 
01207 inline void XMLScanner::setDocTypeHandler(DocTypeHandler* const docTypeHandler)
01208 {
01209     fDocTypeHandler = docTypeHandler;
01210 }
01211 
01212 inline void XMLScanner::setDoNamespaces(const bool doNamespaces)
01213 {
01214     fDoNamespaces = doNamespaces;
01215     if (fDoNamespaces) {
01216         if (!fURIStringPool) {
01217             fURIStringPool = new XMLStringPool();
01218             resetURIStringPool();
01219         }
01220     }
01221 }
01222 
01223 inline void XMLScanner::setErrorReporter(XMLErrorReporter* const errHandler)
01224 {
01225     fErrorReporter = errHandler;
01226     fDTDValidator->setErrorReporter(fErrorReporter);
01227     fSchemaValidator->setErrorReporter(fErrorReporter);
01228 }
01229 
01230 inline void XMLScanner::setErrorHandler(ErrorHandler* const handler)
01231 {
01232     fErrorHandler = handler;
01233 }
01234 
01235 inline void XMLScanner::setEntityHandler(XMLEntityHandler* const entityHandler)
01236 {
01237     fEntityHandler = entityHandler;
01238     fReaderMgr.setEntityHandler(entityHandler);
01239 }
01240 
01241 inline void XMLScanner::setEntityResolver(EntityResolver* const handler)
01242 {
01243     fEntityResolver = handler;
01244 }
01245 
01246 inline void XMLScanner::setExitOnFirstFatal(const bool newValue)
01247 {
01248     fExitOnFirstFatal = newValue;
01249 }
01250 
01251 inline void XMLScanner::setValidationConstraintFatal(const bool newValue)
01252 {
01253     fValidationConstraintFatal = newValue;
01254 }
01255 
01256 inline void XMLScanner::setValidationScheme(const ValSchemes newScheme)
01257 {
01258     fValScheme = newScheme;
01259 
01260     // validation flag for Val_Auto is set to false by default,
01261     //   and will be turned to true if a grammar is seen
01262     if (fValScheme == Val_Always)
01263         fValidate = true;
01264     else
01265         fValidate = false;
01266 }
01267 
01268 inline void XMLScanner::setValidator(XMLValidator* const valToAdopt)
01269 {
01270     if (fValidatorFromUser)
01271         delete fValidator;
01272     fValidator = valToAdopt;
01273     fValidatorFromUser = true;
01274     initValidator(fValidator);
01275 }
01276 
01277 inline void XMLScanner::setDoSchema(const bool doSchema)
01278 {
01279     fDoSchema = doSchema;
01280 }
01281 
01282 inline void XMLScanner::setValidationSchemaFullChecking(const bool schemaFullChecking)
01283 {
01284     fSchemaFullChecking = schemaFullChecking;
01285 }
01286 
01287 inline void XMLScanner::setHasNoDTD(const bool hasNoDTD)
01288 {
01289     fHasNoDTD = hasNoDTD;
01290 }
01291 
01292 inline void XMLScanner::setRootElemName(XMLCh* rootElemName)
01293 {
01294     delete [] fRootElemName;
01295     fRootElemName = XMLString::replicate(rootElemName);
01296 }
01297 
01298 inline void XMLScanner::setExternalSchemaLocation(const XMLCh* const schemaLocation)
01299 {
01300     delete [] fExternalSchemaLocation;
01301     fExternalSchemaLocation = XMLString::replicate(schemaLocation);
01302 }
01303 
01304 inline void XMLScanner::setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation)
01305 {
01306     delete [] fExternalNoNamespaceSchemaLocation;
01307     fExternalNoNamespaceSchemaLocation = XMLString::replicate(noNamespaceSchemaLocation);
01308 }
01309 
01310 inline void XMLScanner::setExternalSchemaLocation(const char* const schemaLocation)
01311 {
01312     delete [] fExternalSchemaLocation;
01313     fExternalSchemaLocation = XMLString::transcode(schemaLocation);
01314 }
01315 
01316 inline void XMLScanner::setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation)
01317 {
01318     delete [] fExternalNoNamespaceSchemaLocation;
01319     fExternalNoNamespaceSchemaLocation = XMLString::transcode(noNamespaceSchemaLocation);
01320 }
01321 
01322 inline void XMLScanner::setURLEntityCaching(const bool useCache)
01323 {
01324     fURLEntityCaching = useCache;
01325 }
01326 
01327 inline void XMLScanner::setURLSetByAPI(const bool setByAPI)
01328 {
01329     fURLSetByAPI = setByAPI;
01330 }
01331 
01332 inline void XMLScanner::setURLEntityCacheDir(const XMLCh* const cacheDir)
01333 {
01334     delete [] fURLEntityCacheDir;
01335     fURLEntityCacheDir = XMLString::replicate(cacheDir);
01336 }
01337 
01338 inline void XMLScanner::setURLEntityCacheDir(const char* const cacheDir)
01339 {
01340     delete [] fURLEntityCacheDir;
01341     fURLEntityCacheDir = XMLString::transcode(cacheDir);
01342 }
01343 
01344 
01345 // ---------------------------------------------------------------------------
01346 //  XMLScanner: Mutator methods
01347 // ---------------------------------------------------------------------------
01348 inline void XMLScanner::incrementErrorCount()
01349 {
01350     ++fErrorCount;
01351 }
01352 
01353 
01354 // ---------------------------------------------------------------------------
01355 //  XMLScanner: Deprecated methods
01356 // ---------------------------------------------------------------------------
01357 inline bool XMLScanner::getDoValidation() const
01358 {
01359     return fValidate;
01360 }
01361 
01362 inline void XMLScanner::setDoValidation(const bool validate, const bool setValScheme)
01363 {
01364     fValidate = validate;
01365     if (setValScheme) {
01366         if (fValidate)
01367             fValScheme = Val_Always;
01368         else
01369             fValScheme = Val_Never;
01370     }
01371 }
01372 
01373 #endif

Generated on Tue Nov 19 09:36:35 2002 by doxygen1.3-rc1