This class implements the SAX 'Parser' interface and should be used by applications wishing to parse the XML files using SAX
Constructors and Destructor
The parser interfaces
Destructor
The document handler interface
protected Constructor
Error Handler interface
The pure virtual methods in this interface.
This class implements the SAX 'Parser' interface and should be used by applications wishing to parse the XML files using SAX. It allows the client program to install SAX handlers for event callbacks.It can be used to instantiate a validating or non-validating parser, by setting a member flag.
const DocumentHandler* getDocumentHandler() const
EntityResolver* getEntityResolver()
const EntityResolver* getEntityResolver() const
ErrorHandler* getErrorHandler()
const ErrorHandler* getErrorHandler() const
const XMLScanner& getScanner() const
const XMLValidator& getValidator() const
bool getDoNamespaces() const
bool getDoValidation() const
bool getExitOnFirstFatalError() const
The parser's default state is: false.
This flag is ignored by the underlying scanner if the installed validator indicates that namespace constraints should be enforced.
By default, the parser does not to any validation. The default
value is false.
The default value is 'true' and the parser exits on the
first fatal error. void setDoValidation(const bool newState)
void setExitOnFirstFatalError(const bool newState)
The methods in the advanced callback interface represent Xerces-C extensions. There is no specification for this interface.
bool removeAdvDocHandler(XMLDocumentHandler* const toRemove)
virtual void parse(const XMLCh* const systemId, const bool reuseValidator = false)
reuseValidator - The flag indicating whether the existing
validator should be reused or not for this
parsing run.
virtual void parse(const char* const systemId, const bool reuseValidator = false)
reuseValidator - The flag indicating whether the existing
validator should be reused or not for this
parsing run. virtual void setDocumentHandler(DocumentHandler* const handler)
virtual void setDTDHandler(DTDHandler* const handler)
virtual void setErrorHandler(ErrorHandler* const handler)
virtual void setEntityResolver(EntityResolver* const resolver)
This method is used to start a progressive parse on a XML file. To continue parsing, subsequent calls must be to the parseNext method.
It scans through the prolog and returns a token to be used on subsequent scanNext() calls. If the return value is true, then the token is legal and ready for further use. If it returns false, then the scan of the prolog failed and the token is not going to work on subsequent scanNext() calls.
This method is used to start a progressive parse on a XML file.
To continue parsing, subsequent calls must be to the parseNext
method.
It scans through the prolog and returns a token to be used on
subsequent scanNext() calls. If the return value is true, then the
token is legal and ready for further use. If it returns false, then
the scan of the prolog failed and the token is not going to work on
subsequent scanNext() calls.
This method is used to start a progressive parse on a XML file.
To continue parsing, subsequent calls must be to the parseNext
method.
It scans through the prolog and returns a token to be used on
subsequent scanNext() calls. If the return value is true, then the
token is legal and ready for further use. If it returns false, then
the scan of the prolog failed and the token is not going to work on
subsequent scanNext() calls.
This method is used to continue with progressive parsing of
XML files started by a call to 'parseFirst' method.
It parses the XML file and stops as soon as it comes across
a XML token (as defined in the XML specification). Relevant
callback handlers are invoked as required by the SAX
specification. bool parseFirst( const char* const systemId, XMLPScanToken& toFill, const bool reuseValidator = false )
toFill - A token maintaing state information to maintain
internal consistency between invocation of 'parseNext'
calls.
reuseValidator - The flag indicating whether the existing validator
should be reused or not for this parsing
run.
parseFirst(XMLCh*,...)
parseFirst(InputSource&,...) bool parseFirst( const InputSource& source, XMLPScanToken& toFill, const bool reuseValidator = false )
toFill - A token maintaing state information to maintain
internal consistency between invocation of 'parseNext'
calls.
reuseValidator - The flag indicating whether the existing validator
should be reused or not for this parsing
process.
parseFirst(XMLCh*,...)
parseFirst(char*,...) bool parseNext(XMLPScanToken& token)
parseFirst(char*,...)
parseFirst(InputSource&,...)
virtual void doctypeComment( const XMLCh* const comment )
virtual void doctypeDecl( const DTDElementDecl& elemDecl, const XMLCh* const publicId, const XMLCh* const systemId, const bool hasIntSubset )
publicId - A const pointer to a Unicode string representing the
public id of the DTD file.
systemId - A const pointer to a Unicode string representing the
system id of the DTD file.
hasIntSubset - A flag indicating if this XML file contains any
internal subset. virtual void doctypePI( const XMLCh* const target, const XMLCh* const data )
data - A const pointer to a Unicode string representing the
data of the PI declaration. See the PI production rule
in the XML specification for details. virtual void doctypeWhitespace( const XMLCh* const chars, const unsigned int length )
length - The length of the whitespace Unicode string. virtual void elementDecl( const DTDElementDecl& decl, const bool isIgnored )
isIgnored - The flag indicating whether this definition was
ignored by the parser or not. virtual void endAttList( const DTDElementDecl& elemDecl )
virtual void endIntSubset()
virtual void endExtSubset()
virtual void entityDecl( const DTDEntityDecl& entityDecl, const bool isPEDecl, const bool isIgnored )
isPEDecl - The flag indicating whether this was a
parameter entity declaration or not.
isIgnored - The flag indicating whether this definition
was ignored by the parser or not.
virtual void resetDocType()
virtual void notationDecl( const XMLNotationDecl& notDecl, const bool isIgnored )
isIgnored - The flag indicating whether this definition was ignored
by the parser or not.
virtual void startAttList( const DTDElementDecl& elemDecl )
virtual void startIntSubset()
virtual void startExtSubset()
virtual void TextDecl( const XMLCh* const versionStr, const XMLCh* const encodingStr )
encodingStr - A const pointer to a Unicode string representing
the encoding name of the 'encoding' clause.
If any advanced callback handlers are installed, the corresponding 'docCharacters' method will also be invoked.
Any PI's occurring before any 'content' are not reported
to any SAX handler as per the specification. However, all
PI's within content are reported via the SAX Document Handler's
'processingInstruction' method.
If any advanced callback handlers are installed, the
corresponding 'docPI' method will be invoked.
In addition, if any advanced callback handlers are installed,
the corresponding 'endDocument' method is invoked.
If any advanced callback handlers are installed, the
corresponding 'endElement' method is also invoked.
If any advanced callback handlers are installed, the
corresponding 'endEnityReference' method is invoked.
Any whitespace before content is not reported to the SAX
Document Handler method, as per the SAX specification.
However, if any advanced callback handlers are installed, the
corresponding 'ignorableWhitespace' method is invoked.
If any advanced callback handlers are installed, then the
corresponding 'startDocument' method is also called.
If any advanced callback handlers are installed, then the
corresponding 'startElement' method is also called.
If any advanced callback handlers are installed, the
corresponding 'endEnityReference' method is invoked.
virtual void docComment( const XMLCh* const comment )
virtual void docPI( const XMLCh* const target, const XMLCh* const data )
data - A const pointer to a Unicode string representing the
data of the PI declaration. See the PI production rule
in the XML specification for details.
virtual void endDocument()
virtual void endElement( const XMLElementDecl& elemDecl, const unsigned int urlId, const bool isRoot )
urlId - An id referring to the namespace prefix, if
namespaces setting is switched on.
isRoot - A flag indicating whether this element was the
root element.
virtual void endEntityReference( const XMLEntityDecl& entDecl )
virtual void ignorableWhitespace( const XMLCh* const chars, const unsigned int length, const bool cdataSection )
length - The length of the Unicode string 'chars'.
cdataSection - A flag indicating if the characters represent
content from the CDATA section.
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 unsigned int attrCount, const bool isEmpty, const bool isRoot )
urlId - An id referring to the namespace prefix, if
namespaces setting is switched on.
elemPrefix - A const pointer to a Unicode string containing
the namespace prefix for this element. Applicable
only when namespace processing is enabled.
attrList - A const reference to the object containing the
list of attributes just scanned for this element.
attrCount - A count of number of attributes in the list
specified by the parameter 'attrList'.
isEmpty - A flag indicating whether this is an empty element
or not.
isRoot - A flag indicating whether this element was the
root element.
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 )
encodingStr - A const pointer to a Unicode string representing
the encoding string value.
standaloneStr - A const pointer to a Unicode string
representing the standalone string value.
actualEncodingStr - A const pointer to a Unicode string
representing the actual encoding string
value.
virtual void resetErrors()
virtual bool expandSystemId( const XMLCh* const systemId, XMLBuffer& toFill )
toFill - A pointer to a buffer in which the application
processed system id is stored.
virtual void resetEntities()
virtual InputSource* resolveEntity( const XMLCh* const publicId, const XMLCh* const systemId )
systemId - A const pointer to a Unicode string representing the
system id of the entity just parsed.
virtual void startInputSource(const InputSource& inputSource)
alphabetic index hierarchy of classes
Xerces-C XML Parser for C++ Version 1.1 |
|
generated by doc++