00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 #ifndef SAX2XMLReader_HPP
00165 #define SAX2XMLReader_HPP
00166
00167 #include <xercesc/util/XercesDefs.hpp>
00168 #include <xercesc/util/XMLUniDefs.hpp>
00169 #include <xercesc/framework/XMLValidator.hpp>
00170 #include <xercesc/framework/XMLPScanToken.hpp>
00171
00172 XERCES_CPP_NAMESPACE_BEGIN
00173
00174 class ContentHandler ;
00175 class DTDHandler;
00176 class EntityResolver;
00177 class ErrorHandler;
00178 class InputSource;
00179 class LexicalHandler;
00180 class DeclHandler;
00181 class XMLDocumentHandler;
00182 class Grammar;
00183
00184 class SAX2XMLReader
00185 {
00186 public:
00187
00188
00189
00192
00200 enum ValSchemes
00201 {
00202 Val_Never
00203 , Val_Always
00204 , Val_Auto
00205 };
00207
00208
00209
00210
00211
00215 SAX2XMLReader()
00216 {
00217 }
00219 virtual ~SAX2XMLReader()
00220 {
00221 }
00223
00224
00225
00226
00229
00235 virtual ContentHandler* getContentHandler() const = 0 ;
00236
00242 virtual DTDHandler* getDTDHandler() const = 0;
00243
00249 virtual EntityResolver* getEntityResolver() const = 0 ;
00250
00256 virtual ErrorHandler* getErrorHandler() const = 0 ;
00257
00265 virtual bool getFeature(const XMLCh* const name) const = 0;
00266
00286 virtual void* getProperty(const XMLCh* const name) const = 0 ;
00287
00304 virtual void setContentHandler(ContentHandler* const handler) = 0;
00305
00321 virtual void setDTDHandler(DTDHandler* const handler) = 0;
00322
00339 virtual void setEntityResolver(EntityResolver* const resolver) = 0;
00340
00358 virtual void setErrorHandler(ErrorHandler* const handler) = 0;
00359
00383 virtual void setFeature(const XMLCh* const name, const bool value) = 0;
00384
00408 virtual void setProperty(const XMLCh* const name, void* value) = 0 ;
00409
00435 virtual void parse
00436 (
00437 const InputSource& source
00438 ) = 0;
00439
00459 virtual void parse
00460 (
00461 const XMLCh* const systemId
00462 ) = 0;
00463
00483 virtual void parse
00484 (
00485 const char* const systemId
00486 ) = 0;
00487
00489
00490
00491
00492
00500 virtual DeclHandler* getDeclarationHandler() const = 0 ;
00501
00507 virtual LexicalHandler* getLexicalHandler() const = 0 ;
00508
00525 virtual void setDeclarationHandler(DeclHandler* const handler) = 0;
00526
00543 virtual void setLexicalHandler(LexicalHandler* const handler) = 0;
00544
00546
00547
00548
00549
00562 virtual XMLValidator* getValidator() const = 0;
00563
00574 virtual int getErrorCount() const = 0 ;
00575
00589 virtual bool getExitOnFirstFatalError() const = 0;
00590
00605 virtual bool getValidationConstraintFatal() const = 0;
00606
00613 virtual Grammar* getGrammar(const XMLCh* const nameSpaceKey) = 0;
00614
00620 virtual Grammar* getRootGrammar() = 0;
00621
00628 virtual const XMLCh* getURIText(unsigned int uriId) const = 0;
00629
00635 virtual unsigned int getSrcOffset() const = 0;
00636
00638
00639
00640
00641
00653 virtual void setValidator(XMLValidator* valueToAdopt) = 0;
00654
00676 virtual void setExitOnFirstFatalError(const bool newState) = 0;
00677
00703 virtual void setValidationConstraintFatal(const bool newState) = 0;
00705
00706
00707
00708
00709
00710
00713
00741 virtual bool parseFirst
00742 (
00743 const XMLCh* const systemId
00744 , XMLPScanToken& toFill
00745 ) = 0;
00746
00774 virtual bool parseFirst
00775 (
00776 const char* const systemId
00777 , XMLPScanToken& toFill
00778 ) = 0;
00779
00807 virtual bool parseFirst
00808 (
00809 const InputSource& source
00810 , XMLPScanToken& toFill
00811 ) = 0;
00812
00837 virtual bool parseNext(XMLPScanToken& token) = 0;
00838
00860 virtual void parseReset(XMLPScanToken& token) = 0;
00861
00863
00864
00865
00866
00867
00897 virtual Grammar* loadGrammar(const InputSource& source,
00898 const short grammarType,
00899 const bool toCache = false) = 0;
00900
00926 virtual Grammar* loadGrammar(const XMLCh* const systemId,
00927 const short grammarType,
00928 const bool toCache = false) = 0;
00929
00954 virtual Grammar* loadGrammar(const char* const systemId,
00955 const short grammarType,
00956 const bool toCache = false) = 0;
00957
00961 virtual void resetCachedGrammarPool() = 0;
00962
00964
00965
00966
00967
00968
00969
00985 virtual void installAdvDocHandler(XMLDocumentHandler* const toInstall) = 0;
00986
00996 virtual bool removeAdvDocHandler(XMLDocumentHandler* const toRemove) = 0;
00998
00999 private :
01000
01001 SAX2XMLReader(const SAX2XMLReader&);
01002
01003
01004 SAX2XMLReader& operator=(const SAX2XMLReader&);
01005
01006 };
01007
01008 XERCES_CPP_NAMESPACE_END
01009
01010 #endif