This method returns the security manager that was specified using setSecurityManager.

The SecurityManager instance must have been specified by the application; this should not be deleted until after the parser has been deleted (or a new SecurityManager instance has been supplied to the parser).

Returns:

a pointer to the SecurityManager instance specified externally. A null pointer is returned if nothing was specified externally.

See also:

setSecurityManager(const SecurityManager* const)

bool SAXParser::getLoadExternalDTD

(

)

const

Get the 'Loading External DTD' flag.

This method returns the state of the parser's loading external DTD flag.

Returns:

false, if the parser is currently configured to ignore external DTD completely, true otherwise.

Retrieve the grammar that is associated with the specified namespace key.

Parameters:

nameSpaceKey

Namespace key

Returns:

Grammar associated with the Namespace key.

Grammar* SAXParser::getRootGrammar

(

)

Retrieve the grammar where the root element is declared.

Returns:

Grammar where root element declared

const XMLCh* SAXParser::getURIText

(

unsigned int

uriId

)

const

Returns the string corresponding to a URI id from the URI string pool.

Parameters:

uriId

id of the string in the URI string pool.

Returns:

URI string corresponding to the URI id.

unsigned int SAXParser::getSrcOffset

(

)

const

Returns the current src offset within the input source.

To be used only while parsing is in progress.

Returns:

offset within the input source

bool SAXParser::getGenerateSyntheticAnnotations

(

)

const

Get the 'generate synthetic annotations' flag.

Returns:

true, if the parser is currently configured to generate synthetic annotations, false otherwise. A synthetic XSAnnotation is created when a schema component has non-schema attributes but has no child annotations so that the non-schema attributes can be recovered under PSVI.

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.

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 will treat validation error as fatal and will exit depends on the state of "getExitOnFirstFatalError". If false, then it will report the error and continue processing.

Note: setting this true does not mean the validation error will be printed with the word "Fatal Error". It is still printed as "Error", but the parser will exit if "setExitOnFirstFatalError" is set to true.

The default value is 'false'.

Parameters:

newState

If true, the parser will exit if "setExitOnFirstFatalError" is set to true.

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.

This method allows users to enable or disable the use of cached grammars. When set to true, the parser will use the cached grammar, instead of building the grammar from scratch, to validate XML documents.

If the 'Grammar caching' flag is set to true, this method ignores the value passed in.

This method allows users to set the scanner to use when scanning a given XML document.

Parameters:

scannerName

The name of the desired scanner

void SAXParser::setInputBufferSize

(

const size_t

bufferSize

)

Set maximum input buffer size.

This method allows users to limit the size of buffers used in parsing XML character data. The effect of setting this size is to limit the size of a ContentHandler::characters() call.

The parser's default input buffer size is 1 megabyte.

Parameters:

bufferSize

The maximum input buffer size

void SAXParser::setIgnoreCachedDTD

(

const bool

newValue

)

Set the 'ignore cached DTD grammar' flag.

This method gives users the option to ignore a cached DTD grammar, when an XML document contains both an internal and external DTD, and the use cached grammar from parse option is enabled. Currently, we do not allow using cached DTD grammar when an internal subset is present in the document. This option will only affect the behavior of the parser when an internal and external DTD both exist in a document (i.e. no effect if document has no internal subset).

The parser's default state is false

Parameters:

newValue

The state to set

void SAXParser::setIgnoreAnnotations

(

const bool

newValue

)

Set the 'ignore annotation' flag.

This method gives users the option to not generate XSAnnotations when "traversing" a schema.

The parser's default state is false

Parameters:

newValue

The state to set

void SAXParser::setDisableDefaultEntityResolution

(

const bool

newValue

)

Set the 'disable default entity resolution' flag.

This method gives users the option to not perform default entity resolution. If the user's resolveEntity method returns NULL the parser will try to resolve the entity on its own. When this option is set to true, the parser will not attempt to resolve the entity when the resolveEntity method returns NULL.

The parser's default state is false

Parameters:

newValue

The state to set

See also:

entityResolver

void SAXParser::setSkipDTDValidation

(

const bool

newValue

)

Set the 'skip DTD validation' flag.

This method gives users the option to skip DTD validation only when schema validation is on (i.e. when performing validation, we will ignore the DTD, except for entities, when schema validation is enabled).

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.

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.)

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.

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.

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.

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.

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.

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.

This method invokes the preparsing process on a schema grammar XML file specified by the SAX InputSource parameter. If the 'toCache' flag is enabled, the parser will cache the grammars for re-use. If a grammar key is found in the pool, no caching of any grammar will take place.

"Experimental - subject to change"

Parameters:

source

A const reference to the SAX InputSource object which points to the schema grammar file to be preparsed.

grammarType

The grammar type (Schema or DTD).

toCache

If true, we cache the preparsed grammar, otherwise, no chaching. Default is false.

Returns:

The preparsed schema grammar object (SchemaGrammar or DTDGrammar). That grammar object is owned by the parser.

This method invokes the preparsing process on a schema grammar XML file specified by the file path parameter. If the 'toCache' flag is enabled, the parser will cache the grammars for re-use. If a grammar key is found in the pool, no caching of any grammar will take place.

"Experimental - subject to change"

Parameters:

systemId

A const XMLCh pointer to the Unicode string which contains the path to the XML grammar file to be preparsed.

grammarType

The grammar type (Schema or DTD).

toCache

If true, we cache the preparsed grammar, otherwise, no chaching. Default is false.

Returns:

The preparsed schema grammar object (SchemaGrammar or DTDGrammar). That grammar object is owned by the parser.

This method invokes the preparsing process on a schema grammar XML file specified by the file path parameter. If the 'toCache' flag is enabled, the parser will cache the grammars for re-use. If a grammar key is found in the pool, no caching of any grammar will take place.

"Experimental - subject to change"

Parameters:

systemId

A const char pointer to a native string which contains the path to the XML grammar file to be preparsed.

grammarType

The grammar type (Schema or DTD).

toCache

If true, we cache the preparsed grammar, otherwise, no chaching. Default is false.

Returns:

The preparsed schema grammar object (SchemaGrammar or DTDGrammar). That grammar object is owned 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.

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.

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.

This method allows a user installed entity handler to further process any pointers to external entities. The applications can implement 'redirection' via this callback.

Parameters:

resourceIdentifier

An object containing the type of resource to be resolved and the associated data members corresponding to this type.

Returns:

The value returned by the user installed resolveEntity method or NULL otherwise to indicate no processing was done. The returned InputSource is owned by the parser which is responsible to clean up the memory.