Main Page   Class Hierarchy   Compound List   File List   Compound Members  

SAXParser Class Reference

Inheritance diagram for SAXParser:

Parser XMLDocumentHandler XMLErrorReporter XMLEntityHandler List of all members.

Public Types

enum  ValSchemes { Val_Never, Val_Always, Val_Auto }

Public Methods

Constructors and Destructor
 SAXParser (XMLValidator *const valToAdopt=0)
 ~SAXParser ()
Getter methods
DocumentHandlergetDocumentHandler ()
const DocumentHandlergetDocumentHandler () const
EntityResolvergetEntityResolver ()
const EntityResolvergetEntityResolver () const
ErrorHandlergetErrorHandler ()
const ErrorHandlergetErrorHandler () const
const XMLScanner & getScanner () const
const XMLValidatorgetValidator () const
ValSchemes getValidationScheme () const
bool getDoSchema () const
bool getValidationSchemaFullChecking () const
int getErrorCount () const
bool getDoNamespaces () const
bool getExitOnFirstFatalError () const
bool getValidationConstraintFatal () const
XMLCh * getExternalSchemaLocation () const
XMLCh * getExternalNoNamespaceSchemaLocation () const
bool getURLEntityCaching () const
XMLCh * getURLEntityCacheDir () const
Setter methods
void setDoNamespaces (const bool newState)
void setValidationScheme (const ValSchemes newScheme)
void setDoSchema (const bool newState)
void setValidationSchemaFullChecking (const bool schemaFullChecking)
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 setURLEntityCaching (const bool useCache)
void setURLEntityCacheDir (const XMLCh *cachedir)
void setURLEntityCacheDir (const char *cachedir)
Advanced document handler list maintenance methods
void installAdvDocHandler (XMLDocumentHandler *const toInstall)
bool removeAdvDocHandler (XMLDocumentHandler *const toRemove)
Implementation of SAX 1.0 interface's.
virtual void parse (const InputSource &source, const bool reuseGrammar=false)
virtual void parse (const XMLCh *const systemId, const bool reuseGrammar=false)
virtual void parse (const char *const systemId, const bool reuseGrammar=false)
virtual void setDocumentHandler (DocumentHandler *const handler)
virtual void setDTDHandler (DTDHandler *const handler)
virtual void setErrorHandler (ErrorHandler *const handler)
virtual void setEntityResolver (EntityResolver *const resolver)
Progressive scan methods
bool parseFirst (const XMLCh *const systemId, XMLPScanToken &toFill, const bool reuseGrammar=false)
bool parseFirst (const char *const systemId, XMLPScanToken &toFill, const bool reuseGrammar=false)
bool parseFirst (const InputSource &source, XMLPScanToken &toFill, const bool reuseGrammar=false)
bool parseNext (XMLPScanToken &token)
void parseReset (XMLPScanToken &token)
Implementation of the 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)
virtual void doctypePI (const XMLCh *const target, const XMLCh *const data)
virtual void doctypeWhitespace (const XMLCh *const chars, const unsigned int 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)
Implementation of the XMLDocumentHandler Interface.
virtual void docCharacters (const XMLCh *const chars, const unsigned int 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)
virtual void endEntityReference (const XMLEntityDecl &entDecl)
virtual void ignorableWhitespace (const XMLCh *const chars, const unsigned int 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 unsigned int 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 unsigned int lineNum, const unsigned int 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 InputSourceresolveEntity (const XMLCh *const publicId, const XMLCh *const systemId)
virtual void startInputSource (const InputSource &inputSource)
Deprecated Methods
bool getDoValidation () const
void setDoValidation (const bool newState)

Protected Methods

 SAXParser (const SAXParser &)
void operator= (const SAXParser &)

Protected Attributes

VecAttrListImpl fAttrList
DocumentHandlerfDocHandler
DTDHandlerfDTDHandler
unsigned int fElemDepth
EntityResolverfEntityResolver
ErrorHandlerfErrorHandler
unsigned int fAdvDHCount
XMLDocumentHandler ** fAdvDHList
unsigned int fAdvDHListSize
bool fParseInProgress
XMLScanner * fScanner

Detailed Description

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.


Constructor & Destructor Documentation

SAXParser::SAXParser XMLValidator *const    valToAdopt = 0
 

Constructor with an instance of validator class to use for validation.

Parameters:
valToAdopt Pointer to the validator instance to use. The parser is responsible for freeing the memory.

SAXParser::~SAXParser  
 

Destructor


Member Function Documentation

void SAXParser::attDef const DTDElementDecl &    elemDecl,
const DTDAttDef &    attDef,
const bool    ignore
[virtual]
 

This method is used to report an attribute definition.

This method is a no-op for this SAX driver implementation.

Parameters:
elemDecl A const reference to the object containing information about the element whose attribute definition was just parsed.
attDef A const reference to the object containing information attribute definition.
ignore The flag indicating whether this attribute definition was ignored by the parser or not.

void SAXParser::docCharacters const XMLCh *const    chars,
const unsigned int    length,
const bool    cdataSection
[virtual]
 

This method is used to report all the characters scanned by the parser. The driver will invoke the 'characters' method of the user installed SAX Document Handler.

If any advanced callback handlers are installed, the corresponding 'docCharacters' method will also be invoked.

Parameters:
chars A const pointer to a Unicode string representing the character data.
length The length of the Unicode string returned in 'chars'.
cdataSection A flag indicating if the characters represent content from the CDATA section.
See also:
DocumentHandler#characters

Implements XMLDocumentHandler.

void SAXParser::docComment const XMLCh *const    comment [virtual]
 

This method is used to report any comments scanned by the parser. This method is a no-op unless, unless an advanced callback handler is installed, in which case the corresponding 'docComment' method is invoked.

Parameters:
comment A const pointer to a null terminated Unicode string representing the comment text.

Implements XMLDocumentHandler.

void SAXParser::docPI const XMLCh *const    target,
const XMLCh *const    data
[virtual]
 

This method is used to report any PI scanned by the parser.

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.

Parameters:
target A const pointer to a Unicode string representing the target of the PI declaration.
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.
See also:
DocumentHandler#processingInstruction

Implements XMLDocumentHandler.

void SAXParser::doctypeComment const XMLCh *const    comment [virtual]
 

This method is used to report a comment occurring within the DTD.

This method is a no-op for this SAX driver implementation.

Parameters:
comment A const pointer to a Unicode string representing the text of the comment just parsed.

void SAXParser::doctypeDecl const DTDElementDecl &    elemDecl,
const XMLCh *const    publicId,
const XMLCh *const    systemId,
const bool    hasIntSubset
[virtual]
 

This method is used to report the DOCTYPE declaration.

This method is a no-op for this SAX driver implementation.

Parameters:
elemDecl A const reference to the object containing information about the root element definition declaration of the XML document being parsed.
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.

void SAXParser::doctypePI const XMLCh *const    target,
const XMLCh *const    data
[virtual]
 

This method is used to report any PI declarations occurring inside the DTD definition block.

This method is a no-op for this SAX driver implementation.

Parameters:
target A const pointer to a Unicode string representing the target of the PI declaration.
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.

void SAXParser::doctypeWhitespace const XMLCh *const    chars,
const unsigned int    length
[virtual]
 

This method is used to report any whitespaces occurring inside the DTD definition block.

This method is a no-op for this SAX driver implementation.

Parameters:
chars A const pointer to a Unicode string representing the whitespace characters.
length The length of the whitespace Unicode string.

void SAXParser::elementDecl const DTDElementDecl &    decl,
const bool    isIgnored
[virtual]
 

This method is used to report an element declarations successfully scanned by the parser.

This method is a no-op for this SAX driver implementation.

Parameters:
decl A const reference to the object containing element declaration information.
isIgnored The flag indicating whether this definition was ignored by the parser or not.

void SAXParser::endAttList const DTDElementDecl &    elemDecl [virtual]
 

This method is used to report the end of an attribute list declaration for an element.

This method is a no-op for this SAX driver implementation.

Parameters:
elemDecl A const reference to the object containing element declaration information.

void SAXParser::endDocument   [virtual]
 

This method is used to indicate the end of root element was just scanned by the parser. Corresponding 'endDocument' method of the user installed SAX Document Handler will also be invoked.

In addition, if any advanced callback handlers are installed, the corresponding 'endDocument' method is invoked.

See also:
DocumentHandler#endDocument

Implements XMLDocumentHandler.

void SAXParser::endElement const XMLElementDecl   elemDecl,
const unsigned int    urlId,
const bool    isRoot
[virtual]
 

This method is used to indicate the end tag of an element. The driver will invoke the corresponding 'endElement' method of the SAX Document Handler interface.

If any advanced callback handlers are installed, the corresponding 'endElement' method is also invoked.

Parameters:
elemDecl A const reference to the object containing element declaration information.
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.
See also:
DocumentHandler#endElement

Implements XMLDocumentHandler.

void SAXParser::endEntityReference const XMLEntityDecl   entDecl [virtual]
 

This method is used to indicate that an end of an entity reference was just scanned.

If any advanced callback handlers are installed, the corresponding 'endEnityReference' method is invoked.

Parameters:
entDecl A const reference to the object containing the entity declaration information.

Implements XMLDocumentHandler.

void SAXParser::endExtSubset   [virtual]
 

This method is used to report the end of the external subset.

This method is a no-op for this SAX driver implementation.

void SAXParser::endInputSource const InputSource   inputSource [virtual]
 

This method is used to indicate the end of parsing of an external entity file.

This method is a no-op for this SAX driver implementation.

Parameters:
inputSource A const reference to the InputSource object which points to the XML file being parsed.
See also:
InputSource

Implements XMLEntityHandler.

void SAXParser::endIntSubset   [virtual]
 

This method is used to report the end of the internal subset.

This method is a no-op for this SAX driver implementation.

void SAXParser::entityDecl const DTDEntityDecl &    entityDecl,
const bool    isPEDecl,
const bool    isIgnored
[virtual]
 

This method is used to report any entity declarations. For unparsed entities, this driver will invoke the SAX DTDHandler::unparsedEntityDecl callback.

Parameters:
entityDecl A const reference to the object containing the entity declaration information.
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.
See also:
DTDHandler#unparsedEntityDecl

void SAXParser::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 unsigned int    lineNum,
const unsigned int    colNum
[virtual]
 

This method is used to report back errors found while parsing the XML file. The driver will call the corresponding user installed SAX Error Handler methods: 'fatal', 'error', 'warning' depending on the severity of the error. This classification is defined by the XML specification.

Parameters:
errCode An integer code for the error.
msgDomain A const pointer to an Unicode string representing the message domain to use.
errType An enumeration classifying the severity of the error.
errorText A const pointer to an Unicode string representing the text of the error message.
systemId A const pointer to an Unicode string representing the system id of the XML file where this error was discovered.
publicId A const pointer to an Unicode string representing the public id of the XML file where this error was discovered.
lineNum The line number where the error occurred.
colNum The column number where the error occurred.
See also:
ErrorHandler

bool SAXParser::expandSystemId const XMLCh *const    systemId,
XMLBuffer   toFill
[virtual]
 

This method allows an installed XMLEntityHandler to further process any system id's of enternal entities encountered in the XML file being parsed, such as redirection etc.

This method always returns 'false' for this SAX driver implementation.

Parameters:
systemId A const pointer to an Unicode string representing the system id scanned by the parser.
toFill A pointer to a buffer in which the application processed system id is stored.
Returns:
'true', if any processing is done, 'false' otherwise.

Implements XMLEntityHandler.

const DocumentHandler * SAXParser::getDocumentHandler   const [inline]
 

This method returns the installed document handler. Suitable only for 'rvalue' usages.

Returns:
A const pointer to the installed document handler object.

DocumentHandler * SAXParser::getDocumentHandler   [inline]
 

This method returns the installed document handler. Suitable for 'lvalue' usages.

Returns:
The pointer to the installed document handler object.

bool SAXParser::getDoNamespaces   const
 

This method returns the state of the parser's namespace handling capability.

Returns:
true, if the parser is currently configured to understand namespaces, false otherwise.
See also:
setDoNamespaces

bool SAXParser::getDoSchema   const
 

Get the 'do schema' flag

This method returns the state of the parser's schema processing flag.

Returns:
true, if the parser is currently configured to understand schema, false otherwise.
See also:
setDoSchema

bool SAXParser::getDoValidation   const
 

This method returns the state of the parser's validation handling flag which controls whether validation checks are enforced or not.

Returns:
true, if the parser is currently configured to do validation, false otherwise.
See also:
setDoValidation

const EntityResolver * SAXParser::getEntityResolver   const [inline]
 

This method returns the installed entity resolver. Suitable for 'rvalue' usages.

Returns:
A const pointer to the installed entity resolver object.

EntityResolver * SAXParser::getEntityResolver   [inline]
 

This method returns the installed entity resolver. Suitable for 'lvalue' usages.

Returns:
The pointer to the installed entity resolver object.

int SAXParser::getErrorCount   const
 

Get error count from the last parse operation.

This method returns the error count from the last parse operation. Note that this count is actually stored in the scanner, so this method simply returns what the scanner reports.

Returns:
number of errors encountered during the latest parse operation.

const ErrorHandler * SAXParser::getErrorHandler   const [inline]
 

This method returns the installed error handler. Suitable for 'rvalue' usages.

Returns:
A const pointer to the installed error handler object.

ErrorHandler * SAXParser::getErrorHandler   [inline]
 

This method returns the installed error handler. Suitable for 'lvalue' usages.

Returns:
The pointer to the installed error handler object.

bool SAXParser::getExitOnFirstFatalError   const
 

This method returns the state of the parser's exit-on-First-Fatal-Error flag.

Returns:
true, if the parser is currently configured to exit on the first fatal error, false otherwise.
See also:
setExitOnFirstFatalError

XMLCh * SAXParser::getExternalNoNamespaceSchemaLocation   const
 

Get the noNamespace SchemaLocation that is specified externaly.

This method returns the no target namespace XML Schema Location that was specified using setExternalNoNamespaceSchemaLocation.

The parser owns the returned string, and the memory allocated for the returned string will be destroyed when the parser is deleted.

To ensure assessiblity of the returned information after the parser is deleted, callers need to copy and store the returned information somewhere else.

Returns:
a pointer to the no target namespace Schema Location that was specified externally. The pointer spans the same life-time as the parser. A null pointer is returned if nothing was specified externally.
See also:
setExternalNoNamespaceSchemaLocation(const XMLCh* const)

XMLCh * SAXParser::getExternalSchemaLocation   const
 

Get the set of Namespace/SchemaLocation that is specified externaly.

This method returns the list of Namespace/SchemaLocation that was specified using setExternalSchemaLocation.

The parser owns the returned string, and the memory allocated for the returned string will be destroyed when the parser is deleted.

To ensure assessiblity of the returned information after the parser is deleted, callers need to copy and store the returned information somewhere else.

Returns:
a pointer to the list of Namespace/SchemaLocation that was specified externally. The pointer spans the same life-time as the parser. A null pointer is returned if nothing was specified externally.
See also:
setExternalSchemaLocation(const XMLCh* const)

const XMLScanner & SAXParser::getScanner   const [inline]
 

This method returns a reference to the underlying scanner object. It allows read only access to data maintained in the scanner.

Returns:
A const reference to the underlying scanner object.

XMLCh * SAXParser::getURLEntityCacheDir   const
 

This method returnsthe absolute path of the directory where the files are cached.

Returns:
a pointer to the location where the entity files are cached. A NULL pointer is returned if no location was specified.
See also:
setURLEntityCacheDir

bool SAXParser::getURLEntityCaching   const
 

This method returns the state of the parser's entity file caching capability.

Returns:
true if the parser is currently configured to cache the external entity files.
See also:
setURLEntityCaching

bool SAXParser::getValidationConstraintFatal   const
 

This method returns the state of the parser's validation-constraint-fatal flag.

Returns:
true, if the parser is currently configured to set validation constraint errors as fatal, false otherwise.
See also:
#setValidationContraintFatal

bool SAXParser::getValidationSchemaFullChecking   const
 

Get the 'full schema constraint checking' flag

This method returns the state of the parser's full schema constraint checking flag.

Returns:
true, if the parser is currently configured to have full schema constraint checking, false otherwise.
See also:
setValidationSchemaFullChecking

SAXParser::ValSchemes SAXParser::getValidationScheme   const
 

This method returns an enumerated value that indicates the current validation scheme set on this parser.

Returns:
The ValSchemes value current set on this parser.
See also:
setValidationScheme

const XMLValidator & SAXParser::getValidator   const
 

This method returns a reference to the parser's installed validator.

Returns:
A const reference to the installed validator object.

void SAXParser::ignorableWhitespace const XMLCh *const    chars,
const unsigned int    length,
const bool    cdataSection
[virtual]
 

This method is used to report all the whitespace characters, which are determined to be 'ignorable'. This distinction between characters is only made, if validation is enabled. Corresponding 'ignorableWhitespace' method of the user installed SAX Document Handler interface is called.

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.

Parameters:
chars A const pointer to a Unicode string representing the ignorable whitespace character data.
length The length of the Unicode string 'chars'.
cdataSection A flag indicating if the characters represent content from the CDATA section.
See also:
DocumentHandler#ignorableWhitespace

Implements XMLDocumentHandler.

void SAXParser::installAdvDocHandler XMLDocumentHandler *const    toInstall
 

This method installs the specified 'advanced' document callback handler, thereby allowing the user to customize the processing, if they choose to do so. Any number of advanced callback handlers maybe installed.

The methods in the advanced callback interface represent Xerces-C extensions. There is no specification for this interface.

Parameters:
toInstall A pointer to the users advanced callback handler.
See also:
removeAdvDocHandler

void SAXParser::notationDecl const XMLNotationDecl   notDecl,
const bool    isIgnored
[virtual]
 

This method is used to report any notation declarations. If there is a user installed DTDHandler, then the driver will invoke the SAX DTDHandler::notationDecl callback.

Parameters:
notDecl A const reference to the object containing the notation declaration information.
isIgnored The flag indicating whether this definition was ignored by the parser or not.
See also:
DTDHandler#notationDecl

void SAXParser::parse const char *const    systemId,
const bool    reuseGrammar = false
[virtual]
 

This method invokes the parsing process on the XML file specified by the native char* string parameter 'systemId'.

Parameters:
systemId A const char pointer to a native string which contains the path to the XML file to be parsed.
reuseGrammar The flag indicating whether the existing Grammar should be reused or not for this parsing run. If true, there cannot be any internal subset.

Implements Parser.

void SAXParser::parse const XMLCh *const    systemId,
const bool    reuseGrammar = false
[virtual]
 

This method invokes the parsing process on the XML file specified by the Unicode string parameter 'systemId'.

Parameters:
systemId A const XMLCh pointer to the Unicode string which contains the path to the XML file to be parsed.
reuseGrammar The flag indicating whether the existing Grammar should be reused or not for this parsing run. If true, there cannot be any internal subset.
See also:
Parser#parse(XMLCh*)

Implements Parser.

void SAXParser::parse const InputSource   source,
const bool    reuseGrammar = false
[virtual]
 

This method invokes the parsing process on the XML file specified by the InputSource parameter.

Parameters:
source A const reference to the InputSource object which points to the XML file to be parsed.
reuseGrammar The flag indicating whether the existing Grammar should be reused or not for this parsing run. If true, there cannot be any internal subset.
See also:
Parser#parse(InputSource)

Implements Parser.

bool SAXParser::parseFirst const InputSource   source,
XMLPScanToken   toFill,
const bool    reuseGrammar = false
 

Begin a progressive parse operation

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.

Parameters:
source A const reference to the InputSource object which points to the XML file to be parsed.
toFill A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls.
reuseGrammar The flag indicating whether the existing Grammar should be reused or not for this parsing run. If true, there cannot be any internal subset.
Returns:
'true', if successful in parsing the prolog. It indicates the user can go ahead with parsing the rest of the file. It returns 'false' to indicate that the parser could not parse the prolog.
See also:
parseNext

parseFirst(XMLCh*,...)

parseFirst(char*,...)

bool SAXParser::parseFirst const char *const    systemId,
XMLPScanToken   toFill,
const bool    reuseGrammar = false
 

Begin a progressive parse operation

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.

Parameters:
systemId A pointer to a regular native string represting the path to the XML file to be parsed.
toFill A token maintaing state information to maintain internal consIstency between invocation of 'parseNext' calls.
reuseGrammar The flag indicating whether the existing Grammar should be reused or not for this parsing run. If true, there cannot be any internal subset.
Returns:
'true', if successful in parsing the prolog. It indicates the user can go ahead with parsing the rest of the file. It returns 'false' to indicate that the parser could not parse the prolog.
See also:
parseNext

parseFirst(XMLCh*,...)

parseFirst(InputSource&,...)

bool SAXParser::parseFirst const XMLCh *const    systemId,
XMLPScanToken   toFill,
const bool    reuseGrammar = false
 

Begin a progressive parse operation

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.

Parameters:
systemId A pointer to a Unicode string represting the path to the XML file to be parsed.
toFill A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls.
reuseGrammar The flag indicating whether the existing Grammar should be reused or not for this parsing run. If true, there cannot be any internal subset.
Returns:
'true', if successful in parsing the prolog. It indicates the user can go ahead with parsing the rest of the file. It returns 'false' to indicate that the parser could parse the prolog (which means the token will not be valid.)
See also:
parseNext

parseFirst(char*,...)

parseFirst(InputSource&,...)

bool SAXParser::parseNext XMLPScanToken   token
 

Continue a progressive parse operation

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.

Parameters:
token A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls.
Returns:
'true', if successful in parsing the next XML token. It indicates the user can go ahead with parsing the rest of the file. It returns 'false' to indicate that the parser could not find next token as per the XML specification production rule.
See also:
parseFirst(XMLCh*,...)

parseFirst(char*,...)

parseFirst(InputSource&,...)

void SAXParser::parseReset XMLPScanToken   token
 

Reset the parser after a progressive parse

If a progressive parse loop exits before the end of the document is reached, the parser has no way of knowing this. So it will leave open any files or sockets or memory buffers that were in use at the time that the parse loop exited.

The next parse operation will cause these open files and such to be closed, but the next parse operation might occur at some unknown future point. To avoid this problem, you should reset the parser if you exit the loop early.

If you exited because of an error, then this cleanup will be done for you. Its only when you exit the file prematurely of your own accord, because you've found what you wanted in the file most likely.

Parameters:
token A token maintaing state information to maintain internal consistency between invocation of 'parseNext' calls.

bool SAXParser::removeAdvDocHandler XMLDocumentHandler *const    toRemove
 

This method removes the 'advanced' document handler callback from the underlying parser scanner. If no handler is installed, advanced callbacks are not invoked by the scanner.

Parameters:
toRemove A pointer to the advanced callback handler which should be removed.
See also:
installAdvDocHandler

void SAXParser::resetDocType   [virtual]
 

This method allows the user installed DTD handler to reset itself.

void SAXParser::resetDocument   [virtual]
 

This method allows the user installed Document Handler and any advanced callback handlers to 'reset' themselves.

Implements XMLDocumentHandler.

void SAXParser::resetEntities   [virtual]
 

This method allows the installed XMLEntityHandler to reset itself.

This method is a no-op for this SAX driver implementation.

Implements XMLEntityHandler.

void SAXParser::resetErrors   [virtual]
 

This method allows the user installed Error Handler callback to 'reset' itself.

This method is a no-op for this SAX driver implementation.

Implements XMLErrorReporter.

InputSource * SAXParser::resolveEntity const XMLCh *const    publicId,
const XMLCh *const    systemId
[virtual]
 

This method allows a user installed entity handler to further process any pointers to external entities. The applications can implement 'redirection' via this callback. The driver should call the SAX EntityHandler 'resolveEntity' method.

Parameters:
publicId A const pointer to a Unicode string representing the public id of the entity just parsed.
systemId A const pointer to a Unicode string representing the system id of the entity just parsed.
Returns:
The value returned by the SAX resolveEntity method or NULL otherwise to indicate no processing was done.
See also:
EntityResolver

Implements XMLEntityHandler.

void SAXParser::setDocumentHandler DocumentHandler *const    handler [virtual]
 

This method installs the user specified SAX Document Handler callback function on parser.

Parameters:
handler A pointer to the document handler to be called when the parser comes across 'document' events as per the SAX specification.
See also:
Parser#parse(char*)

Implements Parser.

void SAXParser::setDoNamespaces const bool    newState
 

This method allows users to enable or disable the parser's namespace processing. When set to true, parser starts enforcing all the constraints / rules specified by the NameSpace specification.

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.

Parameters:
newState The value specifying whether NameSpace rules should be enforced or not.
See also:
getDoNamespaces

void SAXParser::setDoSchema const bool    newState
 

Set the 'schema support' flag

This method allows users to enable or disable the parser's schema processing. When set to false, parser will not process any schema found.

The parser's default state is: false.

Parameters:
newState The value specifying whether schema support should be enforced or not.
See also:
getDoSchema

void SAXParser::setDoValidation const bool    newState
 

This method allows users to enable or disable the parser's validation checks.

By default, the parser does not to any validation. The default value is false.

Parameters:
newState The value specifying whether the parser should do validity checks or not against the DTD in the input XML document.
See also:
getDoValidation

void SAXParser::setDTDHandler DTDHandler *const    handler [virtual]
 

This method installs the user specified DTD handler on the parser.

Parameters:
handler A pointer to the DTD handler to be called when the parser comes across 'DTD' events as per the SAX specification.
See also:
Parser#setDTDHandler

Implements Parser.

void SAXParser::setEntityResolver EntityResolver *const    resolver [virtual]
 

This method installs the user specified entity resolver on the parser. It allows applications to trap and redirect calls to external entities.

Parameters:
resolver A pointer to the entity resolver to be called when the parser comes across references to entities in the XML file.
See also:
Parser#setEntityResolver

Implements Parser.

void SAXParser::setErrorHandler ErrorHandler *const    handler [virtual]
 

This method installs the user specified error handler on the parser.

Parameters:
handler A pointer to the error handler to be called when the parser comes across 'error' events as per the SAX specification.
See also:
Parser#setErrorHandler

Implements Parser.

void SAXParser::setExitOnFirstFatalError const bool    newState
 

This method allows users to set the parser's behaviour when it encounters the first fatal error. If set to true, the parser will exit at the first fatal error. If false, then it will report the error and continue processing.

The default value is 'true' and the parser exits on the first fatal error.

Parameters:
newState The value specifying whether the parser should continue or exit when it encounters the first fatal error.
See also:
getExitOnFirstFatalError

void SAXParser::setExternalNoNamespaceSchemaLocation const char *const    noNamespaceSchemaLocation
 

This method is same as setExternalNoNamespaceSchemaLocation(const XMLCh* const). It takes native char string as parameter

Parameters:
noNamespaceSchemaLocation the XML Schema Location with no target namespace
See also:
setExternalNoNamespaceSchemaLocation(const XMLCh* const)

void SAXParser::setExternalNoNamespaceSchemaLocation const XMLCh *const    noNamespaceSchemaLocation
 

This method allows the user to specify the no target namespace XML Schema Location externally. If specified, the instance document's noNamespaceSchemaLocation attribute will be effectively ignored.

If this method is called more than once, only the last one takes effect.

The syntax is the same as for the noNamespaceSchemaLocation attribute that may occur in an instance document: e.g."file_name.xsd".

Parameters:
noNamespaceSchemaLocation the XML Schema Location with no target namespace
See also:
getExternalNoNamespaceSchemaLocation

void SAXParser::setExternalSchemaLocation const char *const    schemaLocation
 

This method is same as setExternalSchemaLocation(const XMLCh* const). It takes native char string as parameter

Parameters:
schemaLocation the list of schemas to use
See also:
setExternalSchemaLocation(const XMLCh* const)

void SAXParser::setExternalSchemaLocation const XMLCh *const    schemaLocation
 

This method allows the user to specify a list of schemas to use. If the targetNamespace of a schema specified using this method matches the targetNamespace of a schema occuring in the instance document in the schemaLocation attribute, or if the targetNamespace matches the namespace attribute of the "import" element, the schema specified by the user using this method will be used (i.e., the schemaLocation attribute in the instance document or on the "import" element will be effectively ignored).

If this method is called more than once, only the last one takes effect.

The syntax is the same as for schemaLocation attributes in instance documents: e.g, "http://www.example.com file_name.xsd". The user can specify more than one XML Schema in the list.

Parameters:
schemaLocation the list of schemas to use
See also:
getExternalSchemaLocation

void SAXParser::setURLEntityCacheDir const char *    cachedir
 

This method is same as setURLEntityCacheDir(const XMLCh* const). It takes native char string as parameter

Parameters:
cachedir The absolute path of the directory where the files are to be cached.
See also:
getURLEntityCacheDir

void SAXParser::setURLEntityCacheDir const XMLCh *    cachedir
 

Set the absolute path where the files are to be cached.

This method allows the users to specify the absolute path of the directory where the files are to be cached. If this method is not invoked by the user but the Caching is turned on, the current directory is used by default.

The parser's default value is : PWD

Parameters:
cachedir The absolute path of the directory where the files are to be cached.
See also:
getURLEntityCacheDir

void SAXParser::setURLEntityCaching const bool    useCache
 

Set the external entity file caching flag

This method allows users to enable or disable the parsers external entity file caching. When set to false, the external entity files are not cached locally.

The parser's default behaviour is: true. (always caches files)

Parameters:
useCache The value specifying if file caching should be turned on or off.
See also:
getURLEntityCaching

void SAXParser::setValidationConstraintFatal const bool    newState
 

This method allows users to set the parser's behaviour when it encounters a validtion constraint error. If set to true, and the the parser is set to exit when it encounter the first fatal error, the parser will exit at the first encounter. If false, then it will report the error and continue processing.

The default value is 'false'.

Parameters:
newState The value specifying whether the parser should continue or exit when it encounters a validation constraint error.
See also:
getValidationConstraintFatal

void SAXParser::setValidationSchemaFullChecking const bool    schemaFullChecking
 

This method allows the user to turn full Schema constraint checking on/off. Only takes effect if Schema validation is enabled. If turned off, partial constraint checking is done.

Full schema constraint checking includes those checking that may be time-consuming or memory intensive. Currently, particle unique attribution constraint checking and particle derivation resriction checking are controlled by this option.

The parser's default state is: false.

Parameters:
schemaFullChecking True to turn on full schema constraint checking.
See also:
getValidationSchemaFullChecking

void SAXParser::setValidationScheme const ValSchemes    newScheme
 

This method allows users to set the validation scheme to be used by this parser. The value is one of the ValSchemes enumerated values defined by this class:


Val_Never - turn off validation
Val_Always - turn on validation
Val_Auto - turn on validation if any internal/external DTD subset have been seen

The parser's default state is: Val_Auto.

Parameters:
newScheme The new validation scheme to use.
See also:
getValidationScheme

void SAXParser::startAttList const DTDElementDecl &    elemDecl [virtual]
 

This method is used to indicate the start of an element's attribute list declaration.

This method is a no-op for this SAX driver implementation.

Parameters:
elemDecl A const reference to the object containing element declaration information.

void SAXParser::startDocument   [virtual]
 

This method is used to report the start of the parsing process. The corresponding user installed SAX Document Handler's method 'startDocument' is invoked.

If any advanced callback handlers are installed, then the corresponding 'startDocument' method is also called.

See also:
DocumentHandler#startDocument

Implements XMLDocumentHandler.

void SAXParser::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
[virtual]
 

This method is used to report the start of an element. It is called at the end of the element, by which time all attributes specified are also parsed. The corresponding user installed SAX Document Handler's method 'startElement' is invoked.

If any advanced callback handlers are installed, then the corresponding 'startElement' method is also called.

Parameters:
elemDecl A const reference to the object containing element declaration information.
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.
See also:
DocumentHandler#startElement

Implements XMLDocumentHandler.

void SAXParser::startEntityReference const XMLEntityDecl   entDecl [virtual]
 

This method is used to indicate the start of an entity reference.

If any advanced callback handlers are installed, the corresponding 'endEnityReference' method is invoked.

Parameters:
entDecl A const reference to the object containing the entity declaration information.

Implements XMLDocumentHandler.

void SAXParser::startExtSubset   [virtual]
 

This method is used indicate the start of the external subset.

This method is a no-op for this SAX driver implementation.

void SAXParser::startInputSource const InputSource   inputSource [virtual]
 

This method is used to indicate the start of parsing an external entity file.

This method is a no-op for this SAX driver implementation.

Parameters:
inputSource A const reference to the InputSource object which points to the external entity being parsed.

Implements XMLEntityHandler.

void SAXParser::startIntSubset   [virtual]
 

This method is used indicate the start of the internal subset.

This method is a no-op for this SAX driver implementation.

void SAXParser::TextDecl const XMLCh *const    versionStr,
const XMLCh *const    encodingStr
[virtual]
 

This method is used to report the TextDecl. Refer to the XML specification for the syntax of a TextDecl.

This method is a no-op for this SAX driver implementation.

Parameters:
versionStr A const pointer to a Unicode string representing the version number of the 'version' clause.
encodingStr A const pointer to a Unicode string representing the encoding name of the 'encoding' clause.

void SAXParser::XMLDecl const XMLCh *const    versionStr,
const XMLCh *const    encodingStr,
const XMLCh *const    standaloneStr,
const XMLCh *const    actualEncodingStr
[virtual]
 

This method is used to report the XML decl scanned by the parser. Refer to the XML specification to see the meaning of parameters.

This method is a no-op for this SAX driver implementation.

Parameters:
versionStr A const pointer to a Unicode string representing version string value.
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.

Implements XMLDocumentHandler.


The documentation for this class was generated from the following files:
Generated on Tue Nov 19 09:36:46 2002 by doxygen1.3-rc1