Xerces-C++: SAXParser.hpp Source File

Xerces-C++ 3.3.0

SAXParser.hpp
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id$
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_SAXPARSER_HPP)
23#define XERCESC_INCLUDE_GUARD_SAXPARSER_HPP
24
25#include <xercesc/sax/Parser.hpp>
26#include <xercesc/internal/VecAttrListImpl.hpp>
27#include <xercesc/framework/XMLDocumentHandler.hpp>
28#include <xercesc/framework/XMLElementDecl.hpp>
29#include <xercesc/framework/XMLEntityHandler.hpp>
30#include <xercesc/framework/XMLErrorReporter.hpp>
31#include <xercesc/framework/XMLBuffer.hpp>
32#include <xercesc/util/SecurityManager.hpp>
33#include <xercesc/validators/common/Grammar.hpp>
34#include <xercesc/validators/DTD/DocTypeHandler.hpp>
35
36
37 XERCES_CPP_NAMESPACE_BEGIN
38
39
40class DocumentHandler;
41class EntityResolver;
42class XMLPScanToken;
43class XMLScanner;
44class XMLValidator;
45class GrammarResolver;
46class XMLGrammarPool;
47class XMLEntityResolver;
48class XMLResourceIdentifier;
49class PSVIHandler;
50
69 class PARSERS_EXPORT SAXParser :
70
71 public XMemory
72 , public Parser
73 , public XMLDocumentHandler
74 , public XMLErrorReporter
75 , public XMLEntityHandler
76 , public DocTypeHandler
77{
78public :
79 // -----------------------------------------------------------------------
80 // Class types
81 // -----------------------------------------------------------------------
90 enum ValSchemes
91 {
92 Val_Never
93 , Val_Always
94 , Val_Auto
95 };
96
97
98 // -----------------------------------------------------------------------
99 // Constructors and Destructor
100 // -----------------------------------------------------------------------
111 SAXParser
112 (
113 XMLValidator* const valToAdopt = 0
114 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
115 , XMLGrammarPool* const gramPool = 0
116 );
117
121 ~SAXParser();
123
124
125 // -----------------------------------------------------------------------
126 // Getter Methods
127 // -----------------------------------------------------------------------
136 DocumentHandler* getDocumentHandler();
137
144 const DocumentHandler* getDocumentHandler() const;
145
152 EntityResolver* getEntityResolver();
153
160 const EntityResolver* getEntityResolver() const;
161
168 XMLEntityResolver* getXMLEntityResolver();
169
176 const XMLEntityResolver* getXMLEntityResolver() const;
177
184 ErrorHandler* getErrorHandler();
185
192 const ErrorHandler* getErrorHandler() const;
193
200 PSVIHandler* getPSVIHandler();
201
208 const PSVIHandler* getPSVIHandler() const;
209
216 const XMLValidator& getValidator() const;
217
225 ValSchemes getValidationScheme() const;
226
237 bool getDoSchema() const;
238
249 bool getValidationSchemaFullChecking() const;
250
261 bool getIdentityConstraintChecking() const;
262
273 int getErrorCount() const;
274
284 bool getDoNamespaces() const;
285
295 bool getExitOnFirstFatalError() const;
296
307 bool getValidationConstraintFatal() const;
308
328 XMLCh* getExternalSchemaLocation() const;
329
349 XMLCh* getExternalNoNamespaceSchemaLocation() const;
350
366 SecurityManager* getSecurityManager() const;
367
381 XMLSize_t getLowWaterMark() const;
382
395 bool getDisallowDoctype() const;
396
409 bool getLoadExternalDTD() const;
410
422 bool getLoadSchema() const;
423
434 bool isCachingGrammarFromParse() const;
435
446 bool isUsingCachedGrammarInParse() const;
447
459 bool getCalculateSrcOfs() const;
460
471 bool getStandardUriConformant() const;
472
479 Grammar* getGrammar(const XMLCh* const nameSpaceKey);
480
486 Grammar* getRootGrammar();
487
494 const XMLCh* getURIText(unsigned int uriId) const;
495
502 XMLFilePos getSrcOffset() const;
503
515 bool getGenerateSyntheticAnnotations() const;
516
524 bool getValidateAnnotations() const;
525
533 bool getIgnoreCachedDTD() const;
534
542 bool getIgnoreAnnotations() const;
543
551 bool getDisableDefaultEntityResolution() const;
552
560 bool getSkipDTDValidation() const;
561
569 bool getHandleMultipleImports() const;
571
572
573 // -----------------------------------------------------------------------
574 // Setter methods
575 // -----------------------------------------------------------------------
576
589 void setGenerateSyntheticAnnotations(const bool newValue);
590
598 void setValidateAnnotations(const bool newValue);
599
613 void setDoNamespaces(const bool newState);
614
631 void setValidationScheme(const ValSchemes newScheme);
632
648 void setDoSchema(const bool newState);
649
666 void setValidationSchemaFullChecking(const bool schemaFullChecking);
667
679 void setIdentityConstraintChecking(const bool identityConstraintChecking);
680
696 void setExitOnFirstFatalError(const bool newState);
697
717 void setValidationConstraintFatal(const bool newState);
718
739 void setExternalSchemaLocation(const XMLCh* const schemaLocation);
740
749 void setExternalSchemaLocation(const char* const schemaLocation);
750
765 void setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation);
766
775 void setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation);
776
792 void setSecurityManager(SecurityManager* const securityManager);
793
807 void setLowWaterMark(XMLSize_t lwm);
808
824 void setDisallowDoctype(const bool newState);
825
843 void setLoadExternalDTD(const bool newState);
844
860 void setLoadSchema(const bool newState);
861
879 void cacheGrammarFromParse(const bool newState);
880
899 void useCachedGrammarInParse(const bool newState);
900
913 void setCalculateSrcOfs(const bool newState);
914
925 void setStandardUriConformant(const bool newState);
926
934 void useScanner(const XMLCh* const scannerName);
935
946 void setInputBufferSize(const XMLSize_t bufferSize);
947
962 void setIgnoreCachedDTD(const bool newValue);
963
973 void setIgnoreAnnotations(const bool newValue);
974
989 void setDisableDefaultEntityResolution(const bool newValue);
990
1003 void setSkipDTDValidation(const bool newValue);
1004
1016 void setHandleMultipleImports(const bool newValue);
1018
1019
1020 // -----------------------------------------------------------------------
1021 // Advanced document handler list maintenance methods
1022 // -----------------------------------------------------------------------
1023
1041 void installAdvDocHandler(XMLDocumentHandler* const toInstall);
1042
1054 bool removeAdvDocHandler(XMLDocumentHandler* const toRemove);
1056
1057
1058 // -----------------------------------------------------------------------
1059 // Progressive scan methods
1060 // -----------------------------------------------------------------------
1061
1064
1092 bool parseFirst
1093 (
1094 const XMLCh* const systemId
1095 , XMLPScanToken& toFill
1096 );
1097
1125 bool parseFirst
1126 (
1127 const char* const systemId
1128 , XMLPScanToken& toFill
1129 );
1130
1158 bool parseFirst
1159 (
1160 const InputSource& source
1161 , XMLPScanToken& toFill
1162 );
1163
1188 bool parseNext(XMLPScanToken& token);
1189
1211 void parseReset(XMLPScanToken& token);
1212
1214
1215 // -----------------------------------------------------------------------
1216 // Grammar preparsing interface
1217 // -----------------------------------------------------------------------
1218
1247 Grammar* loadGrammar(const InputSource& source,
1248 const Grammar::GrammarType grammarType,
1249 const bool toCache = false);
1250
1275 Grammar* loadGrammar(const XMLCh* const systemId,
1276 const Grammar::GrammarType grammarType,
1277 const bool toCache = false);
1278
1302 Grammar* loadGrammar(const char* const systemId,
1303 const Grammar::GrammarType grammarType,
1304 const bool toCache = false);
1305
1309 void resetCachedGrammarPool();
1310
1312
1313
1314 // -----------------------------------------------------------------------
1315 // Implementation of the SAX Parser interface
1316 // -----------------------------------------------------------------------
1317
1329 virtual void parse(const InputSource& source);
1330
1340 virtual void parse(const XMLCh* const systemId);
1341
1349 virtual void parse(const char* const systemId);
1350
1361 virtual void setDocumentHandler(DocumentHandler* const handler);
1362
1372 virtual void setDTDHandler(DTDHandler* const handler);
1373
1384 virtual void setErrorHandler(ErrorHandler* const handler);
1385
1396 virtual void setPSVIHandler(PSVIHandler* const handler);
1397
1413 virtual void setEntityResolver(EntityResolver* const resolver);
1414
1430 virtual void setXMLEntityResolver(XMLEntityResolver* const resolver);
1431
1433
1434
1435 // -----------------------------------------------------------------------
1436 // Implementation of the XMLDocumentHandler interface
1437 // -----------------------------------------------------------------------
1438
1456 virtual void docCharacters
1457 (
1458 const XMLCh* const chars
1459 , const XMLSize_t length
1460 , const bool cdataSection
1461 );
1462
1472 virtual void docComment
1473 (
1474 const XMLCh* const comment
1475 );
1476
1496 virtual void docPI
1497 (
1498 const XMLCh* const target
1499 , const XMLCh* const data
1500 );
1501
1513 virtual void endDocument();
1514
1534 virtual void endElement
1535 (
1536 const XMLElementDecl& elemDecl
1537 , const unsigned int urlId
1538 , const bool isRoot
1539 , const XMLCh* const elemPrefix
1540 );
1541
1552 virtual void endEntityReference
1553 (
1554 const XMLEntityDecl& entDecl
1555 );
1556
1576 virtual void ignorableWhitespace
1577 (
1578 const XMLCh* const chars
1579 , const XMLSize_t length
1580 , const bool cdataSection
1581 );
1582
1587 virtual void resetDocument();
1588
1599 virtual void startDocument();
1600
1627 virtual void startElement
1628 (
1629 const XMLElementDecl& elemDecl
1630 , const unsigned int urlId
1631 , const XMLCh* const elemPrefix
1632 , const RefVectorOf<XMLAttr>& attrList
1633 , const XMLSize_t attrCount
1634 , const bool isEmpty
1635 , const bool isRoot
1636 );
1637
1647 virtual void startEntityReference
1648 (
1649 const XMLEntityDecl& entDecl
1650 );
1651
1669 virtual void XMLDecl
1670 (
1671 const XMLCh* const versionStr
1672 , const XMLCh* const encodingStr
1673 , const XMLCh* const standaloneStr
1674 , const XMLCh* const actualEncodingStr
1675 );
1677
1678
1679 // -----------------------------------------------------------------------
1680 // Implementation of the XMLErrorReporter interface
1681 // -----------------------------------------------------------------------
1682
1708 virtual void error
1709 (
1710 const unsigned int errCode
1711 , const XMLCh* const msgDomain
1712 , const XMLErrorReporter::ErrTypes errType
1713 , const XMLCh* const errorText
1714 , const XMLCh* const systemId
1715 , const XMLCh* const publicId
1716 , const XMLFileLoc lineNum
1717 , const XMLFileLoc colNum
1718 );
1719
1728 virtual void resetErrors();
1730
1731
1732 // -----------------------------------------------------------------------
1733 // Implementation of the XMLEntityHandler interface
1734 // -----------------------------------------------------------------------
1735
1749 virtual void endInputSource(const InputSource& inputSource);
1750
1765 virtual bool expandSystemId
1766 (
1767 const XMLCh* const systemId
1768 , XMLBuffer& toFill
1769 );
1770
1778 virtual void resetEntities();
1779
1796 virtual InputSource* resolveEntity
1797 (
1798 XMLResourceIdentifier* resourceIdentifier
1799 );
1800
1812 virtual void startInputSource(const InputSource& inputSource);
1814
1815
1816 // -----------------------------------------------------------------------
1817 // Implementation of the Deprecated DocTypeHandler Interface
1818 // -----------------------------------------------------------------------
1835 virtual void attDef
1836 (
1837 const DTDElementDecl& elemDecl
1838 , const DTDAttDef& attDef
1839 , const bool ignore
1840 );
1841
1851 virtual void doctypeComment
1852 (
1853 const XMLCh* const comment
1854 );
1855
1874 virtual void doctypeDecl
1875 (
1876 const DTDElementDecl& elemDecl
1877 , const XMLCh* const publicId
1878 , const XMLCh* const systemId
1879 , const bool hasIntSubset
1880 , const bool hasExtSubset = false
1881 );
1882
1896 virtual void doctypePI
1897 (
1898 const XMLCh* const target
1899 , const XMLCh* const data
1900 );
1901
1913 virtual void doctypeWhitespace
1914 (
1915 const XMLCh* const chars
1916 , const XMLSize_t length
1917 );
1918
1931 virtual void elementDecl
1932 (
1933 const DTDElementDecl& decl
1934 , const bool isIgnored
1935 );
1936
1947 virtual void endAttList
1948 (
1949 const DTDElementDecl& elemDecl
1950 );
1951
1958 virtual void endIntSubset();
1959
1966 virtual void endExtSubset();
1967
1982 virtual void entityDecl
1983 (
1984 const DTDEntityDecl& entityDecl
1985 , const bool isPEDecl
1986 , const bool isIgnored
1987 );
1988
1993 virtual void resetDocType();
1994
2007 virtual void notationDecl
2008 (
2009 const XMLNotationDecl& notDecl
2010 , const bool isIgnored
2011 );
2012
2023 virtual void startAttList
2024 (
2025 const DTDElementDecl& elemDecl
2026 );
2027
2034 virtual void startIntSubset();
2035
2042 virtual void startExtSubset();
2043
2056 virtual void TextDecl
2057 (
2058 const XMLCh* const versionStr
2059 , const XMLCh* const encodingStr
2060 );
2062
2063protected :
2064 // -----------------------------------------------------------------------
2065 // Protected Methods
2066 // -----------------------------------------------------------------------
2073 const XMLScanner& getScanner() const;
2074
2079 GrammarResolver* getGrammarResolver() const;
2080
2081
2082private:
2083 // -----------------------------------------------------------------------
2084 // Unimplemented constructors and operators
2085 // -----------------------------------------------------------------------
2086 SAXParser(const SAXParser&);
2087 SAXParser& operator=(const SAXParser&);
2088
2089 // -----------------------------------------------------------------------
2090 // Initialize/Cleanup methods
2091 // -----------------------------------------------------------------------
2092 void initialize();
2093 void cleanUp();
2094 void resetInProgress();
2095
2096 // -----------------------------------------------------------------------
2097 // Private data members
2098 //
2099 // fAttrList
2100 // A temporary implementation of the basic SAX attribute list
2101 // interface. We use this one over and over on each startElement
2102 // event to allow SAX-like access to the element attributes.
2103 //
2104 // fDocHandler
2105 // The installed SAX doc handler, if any. Null if none.
2106 //
2107 // fDTDHandler
2108 // The installed SAX DTD handler, if any. Null if none.
2109 //
2110 // fElemDepth
2111 // This is used to track the element nesting depth, so that we can
2112 // know when we are inside content. This is so we can ignore char
2113 // data outside of content.
2114 //
2115 // fEntityResolver
2116 // The installed SAX entity handler, if any. Null if none.
2117 //
2118 // fErrorHandler
2119 // The installed SAX error handler, if any. Null if none.
2120 //
2121 // fPSVIHandler
2122 // The installed PSVI handler, if any. Null if none.
2123 //
2124 // fAdvDHCount
2125 // fAdvDHList
2126 // fAdvDHListSize
2127 // This is an array of pointers to XMLDocumentHandlers, which is
2128 // how we see installed advanced document handlers. There will
2129 // usually not be very many at all, so a simple array is used
2130 // instead of a collection, for performance. It will grow if needed,
2131 // but that is unlikely.
2132 //
2133 // The count is how many handlers are currently installed. The size
2134 // is how big the array itself is (for expansion purposes.) When
2135 // count == size, is time to expand.
2136 //
2137 // fParseInProgress
2138 // This flag is set once a parse starts. It is used to prevent
2139 // multiple entrance or reentrance of the parser.
2140 //
2141 // fScanner
2142 // The scanner being used by this parser. It is created internally
2143 // during construction.
2144 //
2145 // fGrammarPool
2146 // The grammar pool passed from external application (through derivatives).
2147 // which could be 0, not owned.
2148 //
2149 // -----------------------------------------------------------------------
2150 bool fParseInProgress;
2151 XMLSize_t fElemDepth;
2152 XMLSize_t fAdvDHCount;
2153 XMLSize_t fAdvDHListSize;
2154 VecAttrListImpl fAttrList;
2155 DocumentHandler* fDocHandler;
2156 DTDHandler* fDTDHandler;
2157 EntityResolver* fEntityResolver;
2158 XMLEntityResolver* fXMLEntityResolver;
2159 ErrorHandler* fErrorHandler;
2160 PSVIHandler* fPSVIHandler;
2161 XMLDocumentHandler** fAdvDHList;
2162 XMLScanner* fScanner;
2163 GrammarResolver* fGrammarResolver;
2164 XMLStringPool* fURIStringPool;
2165 XMLValidator* fValidator;
2166 MemoryManager* fMemoryManager;
2167 XMLGrammarPool* fGrammarPool;
2168 XMLBuffer fElemQNameBuf;
2169};
2170
2171
2172// ---------------------------------------------------------------------------
2173// SAXParser: Getter methods
2174// ---------------------------------------------------------------------------
2175 inline DocumentHandler* SAXParser::getDocumentHandler()
2176{
2177 return fDocHandler;
2178}
2179
2180 inline const DocumentHandler* SAXParser::getDocumentHandler() const
2181{
2182 return fDocHandler;
2183}
2184
2185 inline EntityResolver* SAXParser::getEntityResolver()
2186{
2187 return fEntityResolver;
2188}
2189
2190 inline XMLEntityResolver* SAXParser::getXMLEntityResolver()
2191{
2192 return fXMLEntityResolver;
2193}
2194
2195 inline const XMLEntityResolver* SAXParser::getXMLEntityResolver() const
2196{
2197 return fXMLEntityResolver;
2198}
2199
2200 inline const EntityResolver* SAXParser::getEntityResolver() const
2201{
2202 return fEntityResolver;
2203}
2204
2205 inline ErrorHandler* SAXParser::getErrorHandler()
2206{
2207 return fErrorHandler;
2208}
2209
2210 inline const ErrorHandler* SAXParser::getErrorHandler() const
2211{
2212 return fErrorHandler;
2213}
2214
2215 inline PSVIHandler* SAXParser::getPSVIHandler()
2216{
2217 return fPSVIHandler;
2218}
2219
2220 inline const PSVIHandler* SAXParser::getPSVIHandler() const
2221{
2222 return fPSVIHandler;
2223}
2224
2225 inline const XMLScanner& SAXParser::getScanner() const
2226{
2227 return *fScanner;
2228}
2229
2230 inline GrammarResolver* SAXParser::getGrammarResolver() const
2231{
2232 return fGrammarResolver;
2233}
2234
2235 XERCES_CPP_NAMESPACE_END
2236
2237#endif
Parser.hpp
SecurityManager.hpp
XMLDocumentHandler.hpp
XMLElementDecl.hpp
XMLEntityHandler.hpp
XMLErrorReporter.hpp
PARSERS_EXPORT
#define PARSERS_EXPORT
Definition XercesDefs.hpp:168
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLSize_t
size_t XMLSize_t
Definition Xerces_autoconf_config.hpp:112
XMLCh
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
XMLFilePos
XMLUInt64 XMLFilePos
Definition Xerces_autoconf_config.hpp:139
XMLFileLoc
XMLUInt64 XMLFileLoc
Definition Xerces_autoconf_config.hpp:144
DTDHandler
Receive notification of basic DTD-related events.
Definition DTDHandler.hpp:60
DocumentHandler
Receive notification of general document events.
Definition DocumentHandler.hpp:61
EntityResolver
Basic interface for resolving entities.
Definition EntityResolver.hpp:87
ErrorHandler
Basic interface for SAX error handlers.
Definition ErrorHandler.hpp:61
InputSource
A single input source for an XML entity.
Definition InputSource.hpp:63
MemoryManager
Configurable memory manager.
Definition MemoryManager.hpp:40
PSVIHandler
This abstract class provides the interface for the scanner to return PSVI information to the applicat...
Definition PSVIHandler.hpp:39
Parser
Basic interface for SAX (Simple API for XML) parsers.
Definition Parser.hpp:61
SAXParser
This class implements the SAX 'Parser' interface and should be used by applications wishing to parse ...
Definition SAXParser.hpp:77
SAXParser::docPI
virtual void docPI(const XMLCh *const target, const XMLCh *const data)
This method is used to report any PI scanned by the parser.
SAXParser::setSecurityManager
void setSecurityManager(SecurityManager *const securityManager)
This allows an application to set a SecurityManager on the parser; this object stores information tha...
SAXParser::elementDecl
virtual void elementDecl(const DTDElementDecl &decl, const bool isIgnored)
This method is used to report an element declarations successfully scanned by the parser.
SAXParser::SAXParser
SAXParser(XMLValidator *const valToAdopt=0, MemoryManager *const manager=XMLPlatformUtils::fgMemoryManager, XMLGrammarPool *const gramPool=0)
Constructor with an instance of validator class to use for validation.
SAXParser::parseReset
void parseReset(XMLPScanToken &token)
Reset the parser after a progressive parse.
SAXParser::getIgnoreAnnotations
bool getIgnoreAnnotations() const
Get the 'ignore annotations' flag.
SAXParser::error
virtual void error(const unsigned int errCode, const XMLCh *const msgDomain, const XMLErrorReporter::ErrTypes errType, const XMLCh *const errorText, const XMLCh *const systemId, const XMLCh *const publicId, const XMLFileLoc lineNum, const XMLFileLoc colNum)
This method is used to report back errors found while parsing the XML file.
SAXParser::setSkipDTDValidation
void setSkipDTDValidation(const bool newValue)
Set the 'skip DTD validation' flag.
SAXParser::isUsingCachedGrammarInParse
bool isUsingCachedGrammarInParse() const
Get the 'Use cached grammar' flag.
SAXParser::getXMLEntityResolver
XMLEntityResolver * getXMLEntityResolver()
This method returns the installed entity resolver.
Definition SAXParser.hpp:2190
SAXParser::setPSVIHandler
virtual void setPSVIHandler(PSVIHandler *const handler)
This method installs the user specified PSVI handler on the parser.
SAXParser::setExternalSchemaLocation
void setExternalSchemaLocation(const XMLCh *const schemaLocation)
This method allows the user to specify a list of schemas to use.
SAXParser::useScanner
void useScanner(const XMLCh *const scannerName)
Set the scanner to use when scanning the XML document.
SAXParser::endEntityReference
virtual void endEntityReference(const XMLEntityDecl &entDecl)
This method is used to indicate that an end of an entity reference was just scanned.
SAXParser::getValidationConstraintFatal
bool getValidationConstraintFatal() const
This method returns the state of the parser's validation-constraint-fatal flag.
SAXParser::setIgnoreCachedDTD
void setIgnoreCachedDTD(const bool newValue)
Set the 'ignore cached DTD grammar' flag.
SAXParser::setIdentityConstraintChecking
void setIdentityConstraintChecking(const bool identityConstraintChecking)
This method allows the user to turn identity constraint checking on/off.
SAXParser::setExternalSchemaLocation
void setExternalSchemaLocation(const char *const schemaLocation)
This method is same as setExternalSchemaLocation(const XMLCh* const).
SAXParser::doctypeWhitespace
virtual void doctypeWhitespace(const XMLCh *const chars, const XMLSize_t length)
This method is used to report any whitespaces occurring inside the DTD definition block.
SAXParser::attDef
virtual void attDef(const DTDElementDecl &elemDecl, const DTDAttDef &attDef, const bool ignore)
This method is used to report an attribute definition.
SAXParser::loadGrammar
Grammar * loadGrammar(const InputSource &source, const Grammar::GrammarType grammarType, const bool toCache=false)
Preparse schema grammar (XML Schema, DTD, etc.) via an input source object.
SAXParser::getDisallowDoctype
bool getDisallowDoctype() const
Get the 'Disallow DOCTYPE (DTD)' flag.
SAXParser::startInputSource
virtual void startInputSource(const InputSource &inputSource)
This method is used to indicate the start of parsing an external entity file.
SAXParser::setExternalNoNamespaceSchemaLocation
void setExternalNoNamespaceSchemaLocation(const char *const noNamespaceSchemaLocation)
This method is same as setExternalNoNamespaceSchemaLocation(const XMLCh* const).
SAXParser::startElement
virtual void startElement(const XMLElementDecl &elemDecl, const unsigned int urlId, const XMLCh *const elemPrefix, const RefVectorOf< XMLAttr > &attrList, const XMLSize_t attrCount, const bool isEmpty, const bool isRoot)
This method is used to report the start of an element.
SAXParser::setLowWaterMark
void setLowWaterMark(XMLSize_t lwm)
Set the raw buffer low water mark for this parser.
SAXParser::getLoadSchema
bool getLoadSchema() const
Get the 'Loading Schema' flag.
SAXParser::loadGrammar
Grammar * loadGrammar(const char *const systemId, const Grammar::GrammarType grammarType, const bool toCache=false)
Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL.
SAXParser::doctypeComment
virtual void doctypeComment(const XMLCh *const comment)
This method is used to report a comment occurring within the DTD.
SAXParser::getSrcOffset
XMLFilePos getSrcOffset() const
Returns the current src offset within the input source.
SAXParser::startExtSubset
virtual void startExtSubset()
This method is used indicate the start of the external subset.
SAXParser::getGenerateSyntheticAnnotations
bool getGenerateSyntheticAnnotations() const
Get the 'generate synthetic annotations' flag.
SAXParser::parseFirst
bool parseFirst(const InputSource &source, XMLPScanToken &toFill)
Begin a progressive parse operation.
SAXParser::getStandardUriConformant
bool getStandardUriConformant() const
Get the 'force standard uri flag'.
SAXParser::getLoadExternalDTD
bool getLoadExternalDTD() const
Get the 'Loading External DTD' flag.
SAXParser::resetDocType
virtual void resetDocType()
This method allows the user installed DTD handler to reset itself.
SAXParser::setCalculateSrcOfs
void setCalculateSrcOfs(const bool newState)
Enable/disable src offset calculation.
SAXParser::setHandleMultipleImports
void setHandleMultipleImports(const bool newValue)
Set the 'handle multiple schema imports' flag.
SAXParser::isCachingGrammarFromParse
bool isCachingGrammarFromParse() const
Get the 'Grammar caching' flag.
SAXParser::parse
virtual void parse(const XMLCh *const systemId)
This method invokes the parsing process on the XML file specified by the Unicode string parameter 'sy...
SAXParser::setErrorHandler
virtual void setErrorHandler(ErrorHandler *const handler)
This method installs the user specified error handler on the parser.
SAXParser::getDisableDefaultEntityResolution
bool getDisableDefaultEntityResolution() const
Get the 'disable default entity resolution' flag.
SAXParser::startAttList
virtual void startAttList(const DTDElementDecl &elemDecl)
This method is used to indicate the start of an element's attribute list declaration.
SAXParser::setDisableDefaultEntityResolution
void setDisableDefaultEntityResolution(const bool newValue)
Set the 'disable default entity resolution' flag.
SAXParser::getValidator
const XMLValidator & getValidator() const
This method returns a reference to the parser's installed validator.
SAXParser::setEntityResolver
virtual void setEntityResolver(EntityResolver *const resolver)
This method installs the user specified entity resolver on the parser.
SAXParser::getExternalSchemaLocation
XMLCh * getExternalSchemaLocation() const
Get the set of Namespace/SchemaLocation that is specified externally.
SAXParser::docCharacters
virtual void docCharacters(const XMLCh *const chars, const XMLSize_t length, const bool cdataSection)
This method is used to report all the characters scanned by the parser.
SAXParser::~SAXParser
~SAXParser()
Destructor.
SAXParser::getDocumentHandler
DocumentHandler * getDocumentHandler()
This method returns the installed document handler.
Definition SAXParser.hpp:2175
SAXParser::setDisallowDoctype
void setDisallowDoctype(const bool newState)
Set the 'Disallow DOCTYPE (DTD)' flag.
SAXParser::resetErrors
virtual void resetErrors()
This method allows the user installed Error Handler callback to 'reset' itself.
SAXParser::getDoSchema
bool getDoSchema() const
Get the 'do schema' flag.
SAXParser::endExtSubset
virtual void endExtSubset()
This method is used to report the end of the external subset.
SAXParser::cacheGrammarFromParse
void cacheGrammarFromParse(const bool newState)
Set the 'Grammar caching' flag.
SAXParser::notationDecl
virtual void notationDecl(const XMLNotationDecl &notDecl, const bool isIgnored)
This method is used to report any notation declarations.
SAXParser::ValSchemes
ValSchemes
ValScheme enum used in setValidationScheme Val_Never: Do not report validation errors.
Definition SAXParser.hpp:91
SAXParser::getIgnoreCachedDTD
bool getIgnoreCachedDTD() const
Get the 'ignore cached DTD grammar' flag.
SAXParser::setValidationSchemaFullChecking
void setValidationSchemaFullChecking(const bool schemaFullChecking)
This method allows the user to turn full Schema constraint checking on/off.
SAXParser::getErrorCount
int getErrorCount() const
Get error count from the last parse operation.
SAXParser::parse
virtual void parse(const char *const systemId)
This method invokes the parsing process on the XML file specified by the native char* string paramete...
SAXParser::getScanner
const XMLScanner & getScanner() const
This method returns a reference to the underlying scanner object.
Definition SAXParser.hpp:2225
SAXParser::getExternalNoNamespaceSchemaLocation
XMLCh * getExternalNoNamespaceSchemaLocation() const
Get the noNamespace SchemaLocation that is specified externally.
SAXParser::setDTDHandler
virtual void setDTDHandler(DTDHandler *const handler)
This method installs the user specified DTD handler on the parser.
SAXParser::resetDocument
virtual void resetDocument()
This method allows the user installed Document Handler and any advanced callback handlers to 'reset' ...
SAXParser::setDoNamespaces
void setDoNamespaces(const bool newState)
This method allows users to enable or disable the parser's namespace processing.
SAXParser::getIdentityConstraintChecking
bool getIdentityConstraintChecking() const
Get the 'identity constraint checking' flag.
SAXParser::setValidationScheme
void setValidationScheme(const ValSchemes newScheme)
This method allows users to set the validation scheme to be used by this parser.
SAXParser::setExitOnFirstFatalError
void setExitOnFirstFatalError(const bool newState)
This method allows users to set the parser's behaviour when it encounters the first fatal error.
SAXParser::startDocument
virtual void startDocument()
This method is used to report the start of the parsing process.
SAXParser::getExitOnFirstFatalError
bool getExitOnFirstFatalError() const
This method returns the state of the parser's exit-on-First-Fatal-Error flag.
SAXParser::getHandleMultipleImports
bool getHandleMultipleImports() const
Get the 'handle multiple schema imports' flag.
SAXParser::parseFirst
bool parseFirst(const char *const systemId, XMLPScanToken &toFill)
Begin a progressive parse operation.
SAXParser::doctypePI
virtual void doctypePI(const XMLCh *const target, const XMLCh *const data)
This method is used to report any PI declarations occurring inside the DTD definition block.
SAXParser::endAttList
virtual void endAttList(const DTDElementDecl &elemDecl)
This method is used to report the end of an attribute list declaration for an element.
SAXParser::endElement
virtual void endElement(const XMLElementDecl &elemDecl, const unsigned int urlId, const bool isRoot, const XMLCh *const elemPrefix)
This method is used to indicate the end tag of an element.
SAXParser::setLoadSchema
void setLoadSchema(const bool newState)
Set the 'Loading Schema' flag.
SAXParser::endIntSubset
virtual void endIntSubset()
This method is used to report the end of the internal subset.
SAXParser::getCalculateSrcOfs
bool getCalculateSrcOfs() const
Get the 'calculate src offset flag'.
SAXParser::setGenerateSyntheticAnnotations
void setGenerateSyntheticAnnotations(const bool newValue)
set the 'generate synthetic annotations' flag
SAXParser::startEntityReference
virtual void startEntityReference(const XMLEntityDecl &entDecl)
This method is used to indicate the start of an entity reference.
SAXParser::getValidationSchemaFullChecking
bool getValidationSchemaFullChecking() const
Get the 'full schema constraint checking' flag.
SAXParser::getEntityResolver
EntityResolver * getEntityResolver()
This method returns the installed entity resolver.
Definition SAXParser.hpp:2185
SAXParser::resetEntities
virtual void resetEntities()
This method allows the installed XMLEntityHandler to reset itself.
SAXParser::installAdvDocHandler
void installAdvDocHandler(XMLDocumentHandler *const toInstall)
This method installs the specified 'advanced' document callback handler, thereby allowing the user to...
SAXParser::setStandardUriConformant
void setStandardUriConformant(const bool newState)
Force standard uri.
SAXParser::getSecurityManager
SecurityManager * getSecurityManager() const
Get the SecurityManager instance attached to this parser.
SAXParser::getValidateAnnotations
bool getValidateAnnotations() const
Get the 'validate annotations' flag.
SAXParser::setValidationConstraintFatal
void setValidationConstraintFatal(const bool newState)
This method allows users to set the parser's behaviour when it encounters a validation constraint err...
SAXParser::getDoNamespaces
bool getDoNamespaces() const
This method returns the state of the parser's namespace handling capability.
SAXParser::resetCachedGrammarPool
void resetCachedGrammarPool()
This method allows the user to reset the pool of cached grammars.
SAXParser::parseFirst
bool parseFirst(const XMLCh *const systemId, XMLPScanToken &toFill)
Begin a progressive parse operation.
SAXParser::useCachedGrammarInParse
void useCachedGrammarInParse(const bool newState)
Set the 'Use cached grammar' flag.
SAXParser::getErrorHandler
ErrorHandler * getErrorHandler()
This method returns the installed error handler.
Definition SAXParser.hpp:2205
SAXParser::getGrammarResolver
GrammarResolver * getGrammarResolver() const
Get the Grammar resolver.
Definition SAXParser.hpp:2230
SAXParser::setExternalNoNamespaceSchemaLocation
void setExternalNoNamespaceSchemaLocation(const XMLCh *const noNamespaceSchemaLocation)
This method allows the user to specify the no target namespace XML Schema Location externally.
SAXParser::getValidationScheme
ValSchemes getValidationScheme() const
This method returns an enumerated value that indicates the current validation scheme set on this pars...
SAXParser::setInputBufferSize
void setInputBufferSize(const XMLSize_t bufferSize)
Set maximum input buffer size.
SAXParser::endDocument
virtual void endDocument()
This method is used to indicate the end of root element was just scanned by the parser.
SAXParser::expandSystemId
virtual bool expandSystemId(const XMLCh *const systemId, XMLBuffer &toFill)
This method allows an installed XMLEntityHandler to further process any system id's of external entit...
SAXParser::endInputSource
virtual void endInputSource(const InputSource &inputSource)
This method is used to indicate the end of parsing of an external entity file.
SAXParser::resolveEntity
virtual InputSource * resolveEntity(XMLResourceIdentifier *resourceIdentifier)
Resolve a public/system id.
SAXParser::removeAdvDocHandler
bool removeAdvDocHandler(XMLDocumentHandler *const toRemove)
This method removes the 'advanced' document handler callback from the underlying parser scanner.
SAXParser::doctypeDecl
virtual void doctypeDecl(const DTDElementDecl &elemDecl, const XMLCh *const publicId, const XMLCh *const systemId, const bool hasIntSubset, const bool hasExtSubset=false)
This method is used to report the DOCTYPE declaration.
SAXParser::parse
virtual void parse(const InputSource &source)
This method invokes the parsing process on the XML file specified by the InputSource parameter.
SAXParser::getPSVIHandler
PSVIHandler * getPSVIHandler()
This method returns the installed PSVI handler.
Definition SAXParser.hpp:2215
SAXParser::startIntSubset
virtual void startIntSubset()
This method is used indicate the start of the internal subset.
SAXParser::loadGrammar
Grammar * loadGrammar(const XMLCh *const systemId, const Grammar::GrammarType grammarType, const bool toCache=false)
Preparse schema grammar (XML Schema, DTD, etc.) via a file path or URL.
SAXParser::XMLDecl
virtual void XMLDecl(const XMLCh *const versionStr, const XMLCh *const encodingStr, const XMLCh *const standaloneStr, const XMLCh *const actualEncodingStr)
This method is used to report the XML decl scanned by the parser.
SAXParser::setValidateAnnotations
void setValidateAnnotations(const bool newValue)
set the 'validate annotations' flag
SAXParser::TextDecl
virtual void TextDecl(const XMLCh *const versionStr, const XMLCh *const encodingStr)
This method is used to report the TextDecl.
SAXParser::getLowWaterMark
XMLSize_t getLowWaterMark() const
Get the raw buffer low water mark for this parser.
SAXParser::docComment
virtual void docComment(const XMLCh *const comment)
This method is used to report any comments scanned by the parser.
SAXParser::setXMLEntityResolver
virtual void setXMLEntityResolver(XMLEntityResolver *const resolver)
This method installs the user specified entity resolver on the parser.
SAXParser::getGrammar
Grammar * getGrammar(const XMLCh *const nameSpaceKey)
Retrieve the grammar that is associated with the specified namespace key.
SAXParser::setIgnoreAnnotations
void setIgnoreAnnotations(const bool newValue)
Set the 'ignore annotation' flag.
SAXParser::getSkipDTDValidation
bool getSkipDTDValidation() const
Get the 'skip DTD validation' flag.
SAXParser::setLoadExternalDTD
void setLoadExternalDTD(const bool newState)
Set the 'Loading External DTD' flag.
SAXParser::entityDecl
virtual void entityDecl(const DTDEntityDecl &entityDecl, const bool isPEDecl, const bool isIgnored)
This method is used to report any entity declarations.
SAXParser::setDocumentHandler
virtual void setDocumentHandler(DocumentHandler *const handler)
This method installs the user specified SAX Document Handler callback function on parser.
SAXParser::getURIText
const XMLCh * getURIText(unsigned int uriId) const
Returns the string corresponding to a URI id from the URI string pool.
SAXParser::getRootGrammar
Grammar * getRootGrammar()
Retrieve the grammar where the root element is declared.
SAXParser::ignorableWhitespace
virtual void ignorableWhitespace(const XMLCh *const chars, const XMLSize_t length, const bool cdataSection)
This method is used to report all the whitespace characters, which are determined to be 'ignorable'.
SAXParser::setDoSchema
void setDoSchema(const bool newState)
Set the 'schema support' flag.
SAXParser::parseNext
bool parseNext(XMLPScanToken &token)
Continue a progressive parse operation.
SecurityManager
Allow application to force the parser to behave in a security-conscious way.
Definition SecurityManager.hpp:52
XMLDocumentHandler
This abstract class provides the interface for the scanner to return XML document information up to t...
Definition XMLDocumentHandler.hpp:43
XMLElementDecl
This class defines the core information of an element declaration.
Definition XMLElementDecl.hpp:52
XMLEntityDecl
This class defines that core information that defines an XML entity, no matter what validator is used...
Definition XMLEntityDecl.hpp:51
XMLEntityHandler
This abstract class is a callback mechanism for the scanner.
Definition XMLEntityHandler.hpp:44
XMLEntityResolver
Revised interface for resolving entities.
Definition XMLEntityResolver.hpp:100
XMLErrorReporter
This abstract class defines a callback mechanism for the scanner.
Definition XMLErrorReporter.hpp:43
XMLErrorReporter::ErrTypes
ErrTypes
Definition XMLErrorReporter.hpp:49
XMLGrammarPool
Definition XMLGrammarPool.hpp:44
XMLNotationDecl
This class represents the core information about a notation declaration that all validators must at l...
Definition XMLNotationDecl.hpp:42
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
XMLResourceIdentifier
Definition XMLResourceIdentifier.hpp:96
XMLValidator
This abstract class provides the interface for all validators.
Definition XMLValidator.hpp:53
XMemory
This class makes it possible to override the C++ memory management by adding new/delete operators to ...
Definition XMemory.hpp:41