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.
public virtual GetContentHandler( | oContentHandler) |
public virtual GetDTDHandler( | oDTDHandler) |
public virtual GetEntityResolver( | oEntityResolver) |
public virtual GetErrorHandler( | oErrorHandler) |
public virtual GetFeature( | const | iName, |
oFeature) |
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.
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. |
public virtual GetProperty( | const | iName, |
oProperty) |
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.
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. |
public virtual Parse( | const | iSystemId) |
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.
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 |
public virtual Parse( | const | iInputSource) |
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.
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 |
public virtual SetContentHandler( | const | iContentHandler) |
public virtual SetDTDHandler( | const | iDTDHandler) |
public virtual SetEntityResolver( | const | iEntityResolver) |
public virtual SetErrorHandler( | const | iErrorHandler) |
public virtual SetFeature( | const | iName, |
iFeature) |
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.
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. |
public virtual SetProperty( | const | iName, |
const | iProperty) |
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.
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. |
Copyright © 1999-2014, Dassault Systèmes. All rights reserved.