Unicorn XML Toolkit
Version 1.50.00

Namespace Sax
Class CEntityResolver

class CEntityResolver: virtual public CInterface {
public:
    CEntityResolver();
    virtual ~CEntityResolver();
public:
    virtual XInputSource ResolveEntity(
        const WCHAR *pszPublicId,
        const WCHAR *pszSystemId) = 0;
    };
typedef XInterface<CEntityResolver> XEntityResolver;

The basic interface for resolving entities.

If a SAX application needs to implement customized handling for external entities, it must implement this interface and register an instance with the SAX reader using the CXmlReader::SetEntityResolver method.

The XML reader will then allow the application to intercept any external entities (including the external DTD subset and external parameter entities, if any) before including them.

Many SAX applications will not need to implement this interface, but it will be especially useful for applications that build XML documents from databases or other specialised input sources, or for applications that use URI types other than URLs.

The application can also use this interface to redirect system identifiers to local URIs or to look up replacements in a catalog (possibly by using the public identifier).

Since:
1.00.00
Version:
1.50.00
Author:
C++ interfaces by Alexey Gokhberg; based on the original SAX2 specification by David Megginson
See Also:
CInputSource
Constructor/Destructor Summary
CEntityResolver ();
����������Constructs the entity resolver.
~CEntityResolver ();
����������Destroys the entity resolver.

Function Summary
XInputSource ResolveEntity (const WCHAR *pszPublicId, const WCHAR *pszSystemId);
����������Allows the application to resolve external entities.

Constructor/Destructor Detail

CEntityResolver

CEntityResolver();

Constructs the entity resolver.

~CEntityResolver

virtual ~CEntityResolver();

Destroys the entity resolver.

Function Detail

ResolveEntity

virtual XInputSource ResolveEntity(
    const WCHAR *pszPublicId,
    const WCHAR *pszSystemId) = 0;

Allows the application to resolve external entities.

The reader will call this method before opening any external entity except the top-level document entity (including the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element): the application may request that the reader resolve the entity itself, that it use an alternative URI, or that it use an entirely different input source.

Application writers can use this method to redirect external system identifiers to secure and/or local URIs, to look up public identifiers in a catalogue, or to read an entity from a database or other input source (including, for example, a dialog box).

If the system identifier is a URL, the SAX reader must resolve it fully before reporting it to the application.

Parameters:
pszPublicId - the public identifier of the external entity being referenced, or the empty string if none was supplied
pszSystemId - the system identifier of the external entity being referenced
Returns:
the object describing the new input source, or NULL to request that the reader open a regular URI connection to the system identifier

Unicorn XML Toolkit
Version 1.50.00


This document was created using Unicorn DOC++.

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