Unicorn XML Toolkit
Version 1.00.00

Namespace Sxp
Class IParser

class IParser: public CInterface {
public:
    virtual ~IParser();
public:
    virtual void Parse(CInputSource *pSource) = 0;
    virtual void Parse(const CString &strSystemId) = 0;
    virtual void SetDocumentHandler(
        const XDocumentHandler &pHandler) = 0;
    virtual void SetDtdHandler(const XDtdHandler &pHandler) = 0;
    virtual void SetEntityResolver(
        const XEntityResolver &pResolver) = 0;
    virtual void SetErrorHandler(const XErrorHandler &pHandler) = 0;
    virtual void SetLocale(const CString &strLocale) = 0;
    };

The basic interface to SXP parsers.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
IErrorHandler, IDocumentHandler, IDtdHandler, CInputSource
Constructor/Destructor Summary
~IParser ();
����������Destroys the parser.

Function Summary
void Parse (CInputSource *pSource);
����������Parses an XML document.
void Parse (const CString &strSystemId);
����������Parses an XML document from a system identifier (URI).
void SetDocumentHandler (const XDocumentHandler &pHandler);
����������Allows an application to register a document handler.
void SetDtdHandler (const XDtdHandler &pHandler);
����������Allows an application to register a DTD event handler.
void SetEntityResolver (const XEntityResolver &pResolver);
����������Allows an application to register a custom entity resolver.
void SetErrorHandler (const XErrorHandler &pHandler);
����������Allows an application to register an error handler.
void SetLocale (const CString &strLocale);
����������Allows an application to request for errors and warnings.

Constructor/Destructor Detail

~IParser

virtual ~IParser();

Destroys the parser.

Function Detail

Parse

virtual void Parse(CInputSource *pSource) = 0;

Parses an XML document.

The application can instruct the SXP parser to parse an XML document from any input source (a character stream, a byte stream, or a URI).

Parameters:
pSource - the input source for the the XML document

Parse

virtual void Parse(const CString &strSystemId) = 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.

Parameters:
strSystemId - the system identifier (URI)

SetDocumentHandler

virtual void SetDocumentHandler(
    const XDocumentHandler &pHandler) = 0;

Allows an application to register a document handler.

If the application does not register a document handler, all document events reported by the SXP parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SXP parser must begin using the new handler immediately.

Parameters:
pHandler - the document handler

SetDtdHandler

virtual void SetDtdHandler(const XDtdHandler &pHandler) = 0;

Allows an application to register a DTD event handler.

If the application does not register a DTD handler, all document events reported by the SXP parser will be silently ignored.

Applications may register a new or different handler in the middle of a parse, and the SXP parser must begin using the new handler immediately.

Parameters:
pHandler - the DTD handler

SetEntityResolver

virtual void SetEntityResolver(
    const XEntityResolver &pResolver) = 0;

Allows an application to register a custom entity resolver.

If the application does not register an entity resolver, the SXP parser will resolve system identifiers to entities itself.

Applications may register a new or different entity resolver in the middle of a parse, and the SXP parser must begin using the new entity resolver immediately.

Parameters:
pResolver - the entity resolver

SetErrorHandler

virtual void SetErrorHandler(const XErrorHandler &pHandler) = 0;

Allows an application to register an error handler.

If the application does not register an error handler, all error events will be silently ignored, except for fatal errors, which will throw SXP exceptions.

Applications may register a new or different error handler in the middle of a parse, and the SXP parser must begin using the new error handler immediately.

Parameters:
pHandler - the error handler

SetLocale

virtual void SetLocale(const CString &strLocale) = 0;

Allows an application to request for errors and warnings.

This is a deprecated feature (indeed, it was never supported by the toolkit).

Parameters:
strLocale - the name of the locale

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

Copyright 1999-2001 Unicorn Enterprises SA.
All Rights Reserved.