SAXParser.hpp
Go to the documentation of this file.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id$
*/
#if !defined(XERCESC_INCLUDE_GUARD_SAXPARSER_HPP)
#define XERCESC_INCLUDE_GUARD_SAXPARSER_HPP
#include <xercesc/sax/Parser.hpp>
#include <xercesc/internal/VecAttrListImpl.hpp>
#include <xercesc/framework/XMLDocumentHandler.hpp>
#include <xercesc/framework/XMLElementDecl.hpp>
#include <xercesc/framework/XMLEntityHandler.hpp>
#include <xercesc/framework/XMLErrorReporter.hpp>
#include <xercesc/framework/XMLBuffer.hpp>
#include <xercesc/util/SecurityManager.hpp>
#include <xercesc/validators/common/Grammar.hpp>
#include <xercesc/validators/DTD/DocTypeHandler.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class DocumentHandler;
class EntityResolver;
class XMLPScanToken;
class XMLScanner;
class XMLValidator;
class GrammarResolver;
class XMLGrammarPool;
class XMLEntityResolver;
class XMLResourceIdentifier;
class PSVIHandler;
class PARSERS_EXPORT SAXParser :
public XMemory
, public Parser
, public XMLDocumentHandler
, public XMLErrorReporter
, public XMLEntityHandler
, public DocTypeHandler
{
public :
// -----------------------------------------------------------------------
// Class types
// -----------------------------------------------------------------------
enum ValSchemes
{
Val_Never
, Val_Always
, Val_Auto
};
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
SAXParser
(
XMLValidator* const valToAdopt = 0
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
, XMLGrammarPool* const gramPool = 0
);
~SAXParser();
// -----------------------------------------------------------------------
// Getter Methods
// -----------------------------------------------------------------------
DocumentHandler* getDocumentHandler();
const DocumentHandler* getDocumentHandler() const;
EntityResolver* getEntityResolver();
const EntityResolver* getEntityResolver() const;
XMLEntityResolver* getXMLEntityResolver();
const XMLEntityResolver* getXMLEntityResolver() const;
ErrorHandler* getErrorHandler();
const ErrorHandler* getErrorHandler() const;
PSVIHandler* getPSVIHandler();
const PSVIHandler* getPSVIHandler() const;
const XMLValidator& getValidator() const;
ValSchemes getValidationScheme() const;
bool getDoSchema() const;
bool getValidationSchemaFullChecking() const;
bool getIdentityConstraintChecking() const;
int getErrorCount() const;
bool getDoNamespaces() const;
bool getExitOnFirstFatalError() const;
bool getValidationConstraintFatal() const;
XMLCh* getExternalSchemaLocation() const;
XMLCh* getExternalNoNamespaceSchemaLocation() const;
SecurityManager* getSecurityManager() const;
XMLSize_t getLowWaterMark() const;
bool getLoadExternalDTD() const;
bool getLoadSchema() const;
bool isCachingGrammarFromParse() const;
bool isUsingCachedGrammarInParse() const;
bool getCalculateSrcOfs() const;
bool getStandardUriConformant() const;
Grammar* getGrammar(const XMLCh* const nameSpaceKey);
Grammar* getRootGrammar();
const XMLCh* getURIText(unsigned int uriId) const;
XMLFilePos getSrcOffset() const;
bool getGenerateSyntheticAnnotations() const;
bool getValidateAnnotations() const;
bool getIgnoreCachedDTD() const;
bool getIgnoreAnnotations() const;
bool getDisableDefaultEntityResolution() const;
bool getSkipDTDValidation() const;
bool getHandleMultipleImports() const;
// -----------------------------------------------------------------------
// Setter methods
// -----------------------------------------------------------------------
void setGenerateSyntheticAnnotations(const bool newValue);
void setValidateAnnotations(const bool newValue);
void setDoNamespaces(const bool newState);
void setValidationScheme(const ValSchemes newScheme);
void setDoSchema(const bool newState);
void setValidationSchemaFullChecking(const bool schemaFullChecking);
void setIdentityConstraintChecking(const bool identityConstraintChecking);
void setExitOnFirstFatalError(const bool newState);
void setValidationConstraintFatal(const bool newState);
void setExternalSchemaLocation(const XMLCh* const schemaLocation);
void setExternalSchemaLocation(const char* const schemaLocation);
void setExternalNoNamespaceSchemaLocation(const XMLCh* const noNamespaceSchemaLocation);
void setExternalNoNamespaceSchemaLocation(const char* const noNamespaceSchemaLocation);
void setSecurityManager(SecurityManager* const securityManager);
void setLowWaterMark(XMLSize_t lwm);
void setLoadExternalDTD(const bool newState);
void setLoadSchema(const bool newState);
void cacheGrammarFromParse(const bool newState);
void useCachedGrammarInParse(const bool newState);
void setCalculateSrcOfs(const bool newState);
void setStandardUriConformant(const bool newState);
void useScanner(const XMLCh* const scannerName);
void setInputBufferSize(const XMLSize_t bufferSize);
void setIgnoreCachedDTD(const bool newValue);
void setIgnoreAnnotations(const bool newValue);
void setDisableDefaultEntityResolution(const bool newValue);
void setSkipDTDValidation(const bool newValue);
void setHandleMultipleImports(const bool newValue);
// -----------------------------------------------------------------------
// Advanced document handler list maintenance methods
// -----------------------------------------------------------------------
void installAdvDocHandler(XMLDocumentHandler* const toInstall);
bool removeAdvDocHandler(XMLDocumentHandler* const toRemove);
// -----------------------------------------------------------------------
// Progressive scan methods
// -----------------------------------------------------------------------
bool parseFirst
(
const XMLCh* const systemId
, XMLPScanToken& toFill
);
bool parseFirst
(
const char* const systemId
, XMLPScanToken& toFill
);
bool parseFirst
(
const InputSource& source
, XMLPScanToken& toFill
);
bool parseNext(XMLPScanToken& token);
void parseReset(XMLPScanToken& token);
// -----------------------------------------------------------------------
// Grammar preparsing interface
// -----------------------------------------------------------------------
Grammar* loadGrammar(const InputSource& source,
const Grammar::GrammarType grammarType,
const bool toCache = false);
Grammar* loadGrammar(const XMLCh* const systemId,
const Grammar::GrammarType grammarType,
const bool toCache = false);
Grammar* loadGrammar(const char* const systemId,
const Grammar::GrammarType grammarType,
const bool toCache = false);
void resetCachedGrammarPool();
// -----------------------------------------------------------------------
// Implementation of the SAX Parser interface
// -----------------------------------------------------------------------
virtual void parse(const InputSource& source);
virtual void parse(const XMLCh* const systemId);
virtual void parse(const char* const systemId);
virtual void setDocumentHandler(DocumentHandler* const handler);
virtual void setDTDHandler(DTDHandler* const handler);
virtual void setErrorHandler(ErrorHandler* const handler);
virtual void setPSVIHandler(PSVIHandler* const handler);
virtual void setEntityResolver(EntityResolver* const resolver);
virtual void setXMLEntityResolver(XMLEntityResolver* const resolver);
// -----------------------------------------------------------------------
// Implementation of the XMLDocumentHandler interface
// -----------------------------------------------------------------------
virtual void docCharacters
(
const XMLCh* const chars
, const XMLSize_t length
, const bool cdataSection
);
virtual void docComment
(
const XMLCh* const comment
);
virtual void docPI
(
const XMLCh* const target
, const XMLCh* const data
);
virtual void endDocument();
virtual void endElement
(
const XMLElementDecl& elemDecl
, const unsigned int urlId
, const bool isRoot
, const XMLCh* const elemPrefix
);
virtual void endEntityReference
(
const XMLEntityDecl& entDecl
);
virtual void ignorableWhitespace
(
const XMLCh* const chars
, const XMLSize_t length
, const bool cdataSection
);
virtual void resetDocument();
virtual void startDocument();
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
);
virtual void startEntityReference
(
const XMLEntityDecl& entDecl
);
virtual void XMLDecl
(
const XMLCh* const versionStr
, const XMLCh* const encodingStr
, const XMLCh* const standaloneStr
, const XMLCh* const actualEncodingStr
);
// -----------------------------------------------------------------------
// Implementation of the XMLErrorReporter interface
// -----------------------------------------------------------------------
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
);
virtual void resetErrors();
// -----------------------------------------------------------------------
// Implementation of the XMLEntityHandler interface
// -----------------------------------------------------------------------
virtual void endInputSource(const InputSource& inputSource);
virtual bool expandSystemId
(
const XMLCh* const systemId
, XMLBuffer& toFill
);
virtual void resetEntities();
virtual InputSource* resolveEntity
(
XMLResourceIdentifier* resourceIdentifier
);
virtual void startInputSource(const InputSource& inputSource);
// -----------------------------------------------------------------------
// Implementation of the Deprecated DocTypeHandler Interface
// -----------------------------------------------------------------------
virtual void attDef
(
const DTDElementDecl& elemDecl
, const DTDAttDef& attDef
, const bool ignore
);
virtual void doctypeComment
(
const XMLCh* const comment
);
virtual void doctypeDecl
(
const DTDElementDecl& elemDecl
, const XMLCh* const publicId
, const XMLCh* const systemId
, const bool hasIntSubset
, const bool hasExtSubset = false
);
virtual void doctypePI
(
const XMLCh* const target
, const XMLCh* const data
);
virtual void doctypeWhitespace
(
const XMLCh* const chars
, const XMLSize_t length
);
virtual void elementDecl
(
const DTDElementDecl& decl
, const bool isIgnored
);
virtual void endAttList
(
const DTDElementDecl& elemDecl
);
virtual void endIntSubset();
virtual void endExtSubset();
virtual void entityDecl
(
const DTDEntityDecl& entityDecl
, const bool isPEDecl
, const bool isIgnored
);
virtual void resetDocType();
virtual void notationDecl
(
const XMLNotationDecl& notDecl
, const bool isIgnored
);
virtual void startAttList
(
const DTDElementDecl& elemDecl
);
virtual void startIntSubset();
virtual void startExtSubset();
virtual void TextDecl
(
const XMLCh* const versionStr
, const XMLCh* const encodingStr
);
protected :
// -----------------------------------------------------------------------
// Protected Methods
// -----------------------------------------------------------------------
const XMLScanner& getScanner() const;
GrammarResolver* getGrammarResolver() const;
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
SAXParser(const SAXParser&);
SAXParser& operator=(const SAXParser&);
// -----------------------------------------------------------------------
// Initialize/Cleanup methods
// -----------------------------------------------------------------------
void initialize();
void cleanUp();
void resetInProgress();
// -----------------------------------------------------------------------
// Private data members
//
// fAttrList
// A temporary implementation of the basic SAX attribute list
// interface. We use this one over and over on each startElement
// event to allow SAX-like access to the element attributes.
//
// fDocHandler
// The installed SAX doc handler, if any. Null if none.
//
// fDTDHandler
// The installed SAX DTD handler, if any. Null if none.
//
// fElemDepth
// This is used to track the element nesting depth, so that we can
// know when we are inside content. This is so we can ignore char
// data outside of content.
//
// fEntityResolver
// The installed SAX entity handler, if any. Null if none.
//
// fErrorHandler
// The installed SAX error handler, if any. Null if none.
//
// fPSVIHandler
// The installed PSVI handler, if any. Null if none.
//
// fAdvDHCount
// fAdvDHList
// fAdvDHListSize
// This is an array of pointers to XMLDocumentHandlers, which is
// how we see installed advanced document handlers. There will
// usually not be very many at all, so a simple array is used
// instead of a collection, for performance. It will grow if needed,
// but that is unlikely.
//
// The count is how many handlers are currently installed. The size
// is how big the array itself is (for expansion purposes.) When
// count == size, is time to expand.
//
// fParseInProgress
// This flag is set once a parse starts. It is used to prevent
// multiple entrance or reentrance of the parser.
//
// fScanner
// The scanner being used by this parser. It is created internally
// during construction.
//
// fGrammarPool
// The grammar pool passed from external application (through derivatives).
// which could be 0, not owned.
//
// -----------------------------------------------------------------------
bool fParseInProgress;
XMLSize_t fElemDepth;
XMLSize_t fAdvDHCount;
XMLSize_t fAdvDHListSize;
VecAttrListImpl fAttrList;
DocumentHandler* fDocHandler;
DTDHandler* fDTDHandler;
EntityResolver* fEntityResolver;
XMLEntityResolver* fXMLEntityResolver;
ErrorHandler* fErrorHandler;
PSVIHandler* fPSVIHandler;
XMLDocumentHandler** fAdvDHList;
XMLScanner* fScanner;
GrammarResolver* fGrammarResolver;
XMLStringPool* fURIStringPool;
XMLValidator* fValidator;
MemoryManager* fMemoryManager;
XMLGrammarPool* fGrammarPool;
XMLBuffer fElemQNameBuf;
};
// ---------------------------------------------------------------------------
// SAXParser: Getter methods
// ---------------------------------------------------------------------------
inline DocumentHandler* SAXParser::getDocumentHandler()
{
return fDocHandler;
}
inline const DocumentHandler* SAXParser::getDocumentHandler() const
{
return fDocHandler;
}
inline EntityResolver* SAXParser::getEntityResolver()
{
return fEntityResolver;
}
inline XMLEntityResolver* SAXParser::getXMLEntityResolver()
{
return fXMLEntityResolver;
}
inline const XMLEntityResolver* SAXParser::getXMLEntityResolver() const
{
return fXMLEntityResolver;
}
inline const EntityResolver* SAXParser::getEntityResolver() const
{
return fEntityResolver;
}
inline ErrorHandler* SAXParser::getErrorHandler()
{
return fErrorHandler;
}
inline const ErrorHandler* SAXParser::getErrorHandler() const
{
return fErrorHandler;
}
inline PSVIHandler* SAXParser::getPSVIHandler()
{
return fPSVIHandler;
}
inline const PSVIHandler* SAXParser::getPSVIHandler() const
{
return fPSVIHandler;
}
inline const XMLScanner& SAXParser::getScanner() const
{
return *fScanner;
}
inline GrammarResolver* SAXParser::getGrammarResolver() const
{
return fGrammarResolver;
}
XERCES_CPP_NAMESPACE_END
#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::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::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::getURIText
const XMLCh * getURIText(unsigned int uriId) const
Returns the string corresponding to a URI id from the URI string pool.
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:2157
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::getValidator
const XMLValidator & getValidator() const
This method returns a reference to the parser's installed validator.
SAXParser::getGrammar
Grammar * getGrammar(const XMLCh *const nameSpaceKey)
Retrieve the grammar that is associated with the specified namespace key.
SAXParser::startInputSource
virtual void startInputSource(const InputSource &inputSource)
This method is used to indicate the start of parsing an external entity file.
SAXParser::getExternalSchemaLocation
XMLCh * getExternalSchemaLocation() const
Get the set of Namespace/SchemaLocation that is specified externally.
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::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::getSecurityManager
SecurityManager * getSecurityManager() const
Get the SecurityManager instance attached to this parser.
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::getExternalNoNamespaceSchemaLocation
XMLCh * getExternalNoNamespaceSchemaLocation() const
Get the noNamespace SchemaLocation that is specified externally.
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::setEntityResolver
virtual void setEntityResolver(EntityResolver *const resolver)
This method installs the user specified entity resolver on the parser.
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:2142
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:2192
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::resolveEntity
virtual InputSource * resolveEntity(XMLResourceIdentifier *resourceIdentifier)
Resolve a public/system id.
SAXParser::getEntityResolver
EntityResolver * getEntityResolver()
This method returns the installed entity resolver.
Definition: SAXParser.hpp:2152
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::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:2172
SAXParser::getGrammarResolver
GrammarResolver * getGrammarResolver() const
Get the Grammar resolver.
Definition: SAXParser.hpp:2197
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::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::endInputSource
virtual void endInputSource(const InputSource &inputSource)
This method is used to indicate the end of parsing of an external entity file.
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::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::getPSVIHandler
PSVIHandler * getPSVIHandler()
This method returns the installed PSVI handler.
Definition: SAXParser.hpp:2182
SAXParser::startIntSubset
virtual void startIntSubset()
This method is used indicate the start of the internal subset.
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::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::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