All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

XMLParser Interface CATISAXParser

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---CATISAXParser
 

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


interface CATISAXParser

Interface for SAX (Simple API for XML) parsers.
All SAX parsers must implement this basic interface: it allows applications to register handlers for different types of events and to initiate a parse from a URI, or a character stream. All SAX parsers must also implement a zero-argument constructor (though other constructors are also allowed). SAX parsers are reusable but not re-entrant: the application may reuse a parser object (possibly with a different input source) once the first parse has completed successfully, but it may not invoke the Parse methods recursively within a parse.

See also:
CATISAXEntityResolver, CATISAXDTDHandler, CATISAXDocumentHandler, CATISAXErrorHandler, CATSAXHandlerBase, CATISAXInputSource


Method Index


o Parse(CATISAXInputSource_var&)
Parses an XML document.
o Parse(CATUnicodeString&)
Parses an XML document from a system identifier (URI).
o SetDTDHandler(CATISAXDTDHandler_var&)
Allows an application to register a DTD event handler.
o SetDocumentHandler(CATISAXDocumentHandler_var&)
Allows an application to register a document 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.

Methods


o Parse
public virtual HRESULT Parse( const CATISAXInputSource_var& iInputSource) = 0
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 CATISAXParser instead for each additional XML document). Once a parse is complete, an application may reuse the same Parser object, possibly with a different input source.
Parameters:
iInputSource
The input source for the top-level of the XML document.
Errors Returned:
Error Class Error Id Description
CATSAXException XMLParserERR_2000 If an error (such as a not well formed XML document) occurs during parse
CATSAXException XMLParserERR_2001 If an I/O error occurs during parse
See also:
CATISAXInputSource, SetEntityResolver, SetDTDHandler, SetDocumentHandler, SetErrorHandler
o Parse
public virtual HRESULT Parse( const CATUnicodeString& iSystemId) = 0
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
CATSAXException XMLParserERR_2000 If an error (such as a not well formed XML document) occurs during parse
CATSAXException XMLParserERR_2001 If an I/O error occurs during parse
See also:
Parse
o SetDTDHandler
public virtual HRESULT SetDTDHandler( const CATISAXDTDHandler_var& iDTDHandler) = 0
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 CATSAXHandlerBase ). 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:
CATISAXDTDHandler, CATSAXHandlerBase
o SetDocumentHandler
public virtual HRESULT SetDocumentHandler( const CATISAXDocumentHandler_var& iDocumentHandler) = 0
Allows an application to register a document event handler. If the application does not register a document handler, all document events reported by the SAX parser will be silently ignored (this is the default behaviour implemented by CATSAXHandlerBase ). 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:
iDocumentHandler
The document handler.
See also:
CATISAXDocumentHandler, CATSAXHandlerBase
o SetEntityResolver
public virtual HRESULT SetEntityResolver( const CATISAXEntityResolver_var& iEntityResolver) = 0
Allows an application to register a custom entity resolver. If the application does not register an entity resolver, the SAX parser will resolve system identifiers and open connections to entities itself (this is the default behaviour implemented in CATSAXHandlerBase ). 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:
CATISAXEntityResolver, CATSAXHandlerBase
o SetErrorHandler
public virtual HRESULT SetErrorHandler( const CATISAXErrorHandler_var& iErrorHandler) = 0
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 CATISAXErrorHandler.FatalError, which will raise a CATSAXException error (this is the default behaviour implemented by CATSAXHandlerBase ). 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:
handler
The error handler.
See also:
CATISAXErrorHandler, CATSAXException, CATSAXHandlerBase

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

Copyright © 2003, Dassault Systèmes. All rights reserved.