XMLParserItf Interface CATISAXXMLReader

Usage: an implementation of this interface is supplied and you must use it as is. You should not reimplement it.


interface CATISAXXMLReader

Interface for reading an XML document using callbacks.

CATISAXXMLReader is the interface that an XML parser's SAX2 driver must implement. This interface allows an application to set and query features and properties in the parser, to register event handlers for document processing, and to initiate a document parse.

All SAX interfaces are assumed to be synchronous: the methods must not return until parsing is complete, and readers must wait for an event-handler callback to return before reporting the next event.

See also:
, , , , ,


Method Index


o GetContentHandler(CATISAXContentHandler_var&)
Retrieves the current content event handler.
o GetDTDHandler(CATISAXDTDHandler_var&)
Retrieves the current DTD event handler.
o GetEntityResolver(CATISAXEntityResolver_var&)
Retrieves the current entity resolver.
o GetErrorHandler(CATISAXErrorHandler_var&)
Retrieves the current error event handler.
o GetFeature(CATUnicodeString&,CATBoolean&)
Retrieves the value of a feature.
o GetProperty(CATUnicodeString&,CATBaseUnknown_var&)
Retrieves up the value of a property.
o Parse(CATUnicodeString&)
Parses an XML document from a system identifier (URI).
o Parse(CATISAXInputSource_var&)
Parses an XML document.
o SetContentHandler(CATISAXContentHandler_var&)
Allows an application to register a content event handler.
o SetDTDHandler(CATISAXDTDHandler_var&)
Allows an application to register a DTD event handler.
o SetEntityResolver(CATISAXEntityResolver_var&)
Allows an application to register a custom entity resolver.
o SetErrorHandler(CATISAXErrorHandler_var&)
Allows an application to register an error event handler.
o SetFeature(CATUnicodeString&,CATBoolean)
Sets the value of a feature.
o SetProperty(CATUnicodeString&,CATBaseUnknown_var&)
Sets the value of a property.

Methods


o GetContentHandler
public virtual GetContentHandler( oContentHandler)
Retrieves the current content event handler.
Parameters:
oContentHandler
The content handler.
See also:
, ,
o GetDTDHandler
public virtual GetDTDHandler( oDTDHandler)
Retrieves the current DTD event handler.
Parameters:
oDTDHandler
The DTD handler.
See also:
, ,
o GetEntityResolver
public virtual GetEntityResolver( oEntityResolver)
Retrieves the current entity resolver.
Parameters:
oEntityResolver
The entity resolver.
See also:
, ,
o GetErrorHandler
public virtual GetErrorHandler( oErrorHandler)
Retrieves the current error event handler.
Parameters:
oErrorHandler
The error event handler.
See also:
, ,
o GetFeature
public virtual GetFeature( const iName,
oFeature)
Retrieves the value of a feature.

The feature name is any fully-qualified URI. It is possible for an to recognize a feature name but to be unable to return its value.

All s are required to recognize the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes feature names.

Some feature values may be available only in specific contexts, such as before, during, or after a parse.

Typical usage is something like this:

 CATISAXReader_var r;
 hr = factory->CreateReader(r);
 if (SUCCEEDED(hr) && (r != NULL_var)) {
     hr = r->SetFeature("http://xml.org/sax/features/validation", TRUE);
     if (FAILED(hr)) {
         cerr << "Cannot activate validation." << endl;
     } else {
         CATISAXContentHandler_var myContentHandler;
         MyContentHandler* myContentHandlerImpl = new MyContentHandler();
         myContentHandler = myContentHandlerImpl;
         myContentHandlerImpl->Release();
         myContentHandlerImpl = NULL;
 
         CATISAXErrorHandler_var myErrorHandler;
         MyErrorHandler* myErrorHandlerImpl = new MyErrorHandler();
         myErrorHandler = myErrorHandlerImpl;
         myErrorHandlerImpl->Release();
         myErrorHandlerImpl = NULL;
 
         r->SetContentHandler(myContentHandler);
         r->SetErrorHandler(myErrorHandlerImpl);
         hr = Parse("http://www.foo.com/mydoc.xml");
         if (FAILED(hr)) {
             CATError *error = CATError::CATGetLastError();
             if (error != NULL) {
                 cerr << error->GetNLSMessage().CastToCharPtr() << endl;
                 error->Release();
                 error = NULL;
             } else {
                 cerr << "Unknown error." << endl;
             }
         }
     }
 }
 

Implementors are free (and encouraged) to invent their own features, using names built on their own URIs.

Parameters:
iName
The feature name, which is a fully-qualified URI.
oFeature
The current state of the feature (TRUE or FALSE).
Errors Returned:
Error Class Error Id Description
XMLParserERR_2302 If the does not recognize the feature name.
XMLParserERR_2303 When the XMLReader recognizes the feature name but cannot determine its value at this time.
See also:
o GetProperty
public virtual GetProperty( const iName,
oProperty)
Retrieves up the value of a property.

The property name is any fully-qualified URI. It is possible for a to recognize a property name but to be unable to return its state .

s are not required to recognize any specific property names, though an initial core set is documented for SAX2.

Some property values may be available only in specific contexts, such as before, during, or after a parse.

Implementors are free (and encouraged) to invent their own properties, using names built on their own URIs.

Parameters:
iName
The property name, which is a fully-qualified URI.
oProperty
The current value of the property.
Errors Returned:
Error Class Error Id Description
XMLParserERR_2300 If the does not recognize the feature name.
XMLParserERR_2301 When the XMLReader recognizes the feature name but cannot determine its value at this time.
See also:
o Parse
public virtual Parse( const iSystemId)
Parses an XML document from a system identifier (URI).

This method is a shortcut for the common case of reading a document from a system identifier. If the system identifier is a URL, it must be fully resolved by the application before it is passed to the parser.

Parameters:
iSystemId
The system identifier (URI).
Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 If an error (such as a not well formed XML document) occurs during parse
XMLParserERR_2001 If an I/O error occurs during parse
See also:
o Parse
public virtual Parse( const iInputSource)
Parses an XML document.

The application can use this method to instruct the SAX parser to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

Applications may not invoke this method while a parse is in progress (they should create a new instead for each additional XML document). Once a parse is complete, an application may reuse the same reader object, possibly with a different input source.

During the parse, the will provide information about the XML document through the registered event handlers.

This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should raise an error.

Parameters:
iInputSource
The input source for the top-level of the XML document.
Errors Returned:
Error Class Error Id Description
XMLParserERR_2000 If an error (such as a not well formed XML document) occurs during parse
XMLParserERR_2001 If an I/O error occurs during parse
See also:
, , , ,
o SetContentHandler
public virtual SetContentHandler( const iContentHandler)
Allows an application to register a content event handler. If the application does not register a content handler, all content events reported by the SAX parser will be silently ignored (this is the default behaviour implemented by ). Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
Parameters:
iContentHandler
The content handler.
See also:
, ,
o SetDTDHandler
public virtual SetDTDHandler( const iDTDHandler)
Allows an application to register a DTD event handler. If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored (this is the default behaviour implemented by ). Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
Parameters:
iDTDHandler
The DTD handler.
See also:
, ,
o SetEntityResolver
public virtual SetEntityResolver( const iEntityResolver)
Allows an application to register a custom entity resolver. If the application does not register an entity resolver, the SAX reader will resolve system identifiers and open connections to entities itself (this is the default behaviour implemented in ). Applications may register a new or different entity resolver in the middle of a parse, and the SAX parser must begin using the new resolver immediately.
Parameters:
iEntityResolver
The object for resolving entities.
See also:
, ,
o SetErrorHandler
public virtual SetErrorHandler( const iErrorHandler)
Allows an application to register an error event handler. If the application does not register an error event handler, all error events reported by the SAX parser will be silently ignored, except for , which will raise a error (this is the default behaviour implemented by ). Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.
Parameters:
iErrorHandler
The error handler.
See also:
, ,
o SetFeature
public virtual SetFeature( const iName,
iFeature)
Sets the value of a feature.

The feature name is any fully-qualified URI. It is possible for an to recognize a feature name but to be unable to set its value.

All s are required to support setting http://xml.org/sax/features/namespaces to TRUE and http://xml.org/sax/features/namespace-prefixes to FALSE.

Some feature values may be immutable or mutable only in specific contexts, such as before, during, or after a parse.

Parameters:
iName
The feature name, which is a fully-qualified URI.
oFeature
The requested state of the feature (TRUE or FALSE).
Errors Returned:
Error Class Error Id Description
XMLParserERR_2302 If the does not recognize the feature name.
XMLParserERR_2303 When the XMLReader recognizes the feature name but cannot determine its value at this time.
See also:
o SetProperty
public virtual SetProperty( const iName,
const iProperty)
Sets the value of a property.

The property name is any fully-qualified URI. It is possible for a to recognize a property name but to be unable to return its state.

s are not required to recognize any specific property names, though an initial core set is documented for SAX2.

Some property values may be available only in specific contexts, such as before, during, or after a parse.

Implementors are free (and encouraged) to invent their own properties, using names built on their own URIs.

Parameters:
iName
The property name, which is a fully-qualified URI.
iProperty
The requested value for the property.
Errors Returned:
Error Class Error Id Description
XMLParserERR_2300 If the does not recognize the feature name.
XMLParserERR_2301 When the XMLReader recognizes the feature name but cannot determine its value at this time.
See also:

This object is included in the file: CATISAXXMLReader.h
If needed, your Imakefile.mk should include the module: CatXmlItfBase

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.