Unicorn XML Toolkit
Version 1.00.00

Namespace Sxp
Class IDocumentHandler

class IDocumentHandler: public CInterface {
public:
    virtual ~IDocumentHandler();
public:
    virtual void SetDocumentLocator(const XLocator &pLocator) = 0;
    virtual void StartDocument() = 0;
    virtual void EndDocument() = 0;
    virtual void StartElement(const CString &strName) = 0;
    virtual void EndElement() = 0;
    virtual void StartAttribute(const CString &strName) = 0;
    virtual void EndAttribute() = 0;
    virtual void CharacterData(
        const WCHAR *pData, int nSize) = 0;
    virtual void StartComment() = 0;
    virtual void EndComment() = 0;
    virtual void StartCdataSection() = 0;
    virtual void EndCdataSection() = 0;
    virtual void EntityReference(const CString &strName) = 0;
    virtual void ProcessingInstruction(
        const CString &strTarget, const CString &strData) = 0;
    };

The abstract interface for receiving notifications of general document events.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
ILocator
Constructor/Destructor Summary
~IDocumentHandler ();
����������Destroys the document handler.

Function Summary
void SetDocumentLocator (const XLocator &pLocator);
����������Receives the object for locating the origin of SXP document events.
void StartDocument ();
����������Receives notification of the beginning of a document.
void EndDocument ();
����������Receives notification of the end of a document.
void StartElement (const CString &strName);
����������Receives notification of the beginning of an element.
void EndElement ();
����������Receives notification of the end of an element.
void StartAttribute (const CString &strName);
����������Receives notification of the beginning of an attribute.
void EndAttribute ();
����������Receives notification of the end of an attribute.
void CharacterData (const WCHAR *pData, int nSize);
����������Receives notification of character data.
void StartComment ();
����������Receives notification of the beginning of a comment.
void EndComment ();
����������Receives notification of the end of a comment.
void StartCdataSection ();
����������Receives notification of the beginning of a CDATA section.
void EndCdataSection ();
����������Receives notification of the end of a CDATA section.
void EntityReference (const CString &strName);
����������Receives notification of an entity reference.
void ProcessingInstruction (const CString &strTarget, const CString &strData);
����������Receives notification of a processing instruction.

Constructor/Destructor Detail

~IDocumentHandler

virtual ~IDocumentHandler();

Destroys the document handler.

Function Detail

SetDocumentLocator

virtual void SetDocumentLocator(const XLocator &pLocator) = 0;

Receives the object for locating the origin of SXP document events.

Parameters:
pLocator - the locator object

StartDocument

virtual void StartDocument() = 0;

Receives notification of the beginning of a document.

The SXP parser will invoke this method only once, before any other methods in this interface or in IDtdHandler .

EndDocument

virtual void EndDocument() = 0;

Receives notification of the end of a document.

The SXP parser will invoke this method only once, and it will be the last method invoked during the parse.

StartElement

virtual void StartElement(const CString &strName) = 0;

Receives notification of the beginning of an element.

The SXP parser will invoke this method at the beginning of every element in the XML document; there will be a corresponding EndElement event for every StartElement event (even when the element is empty). All of the element's attributes, followed by all of the element's content will be reported, in order, before the corresponding EndElement event.

Parameters:
strName - the element type name

EndElement

virtual void EndElement() = 0;

Receives notification of the end of an element.

The SXP parser will invoke this method at the end of every element in the XML document; there will be a corresponding StartElement event for every EndElement event (even when the element is empty).

StartAttribute

virtual void StartAttribute(const CString &strName) = 0;

Receives notification of the beginning of an attribute.

The SXP parser will invoke this method at the beginning of every attribute declaration in the XML document; there will be a corresponding EndAttribute event for every StartAttribute event. The attribute value will be reported as one or more CharacterData events, before the corresponding EndAttribute event.

Parameters:
strName - the attribute name

EndAttribute

virtual void EndAttribute() = 0;

Receives notification of the end of an attribute.

The SXP parser will invoke this method at the end of every attribute declaration in the XML document; there will be a corresponding StartAttribute event for every EndAttribute event.

CharacterData

virtual void CharacterData(
    const WCHAR *pData, int nSize) = 0;

Receives notification of character data.

The SXP parser will call this method to report each chunk of character data, each chunk of the content of the any comment, and each chunk of any attribute value.

SXP parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity.

Parameters:
pData - the array of characters
nSize - the number of characters to read from the array

StartComment

virtual void StartComment() = 0;

Receives notification of the beginning of a comment.

The SXP parser will invoke this method at the beginning of every comment in the XML document; there will be a corresponding EndComment event for every StartComment event. The contents of the comment will be reported as one or more CharacterData events, before the corresponding EndComment event.

EndComment

virtual void EndComment() = 0;

Receives notification of the end of a comment.

The SXP parser will invoke this method at the end of every comment in the XML document; there will be a corresponding StartComment event for every EndComment event.

StartCdataSection

virtual void StartCdataSection() = 0;

Receives notification of the beginning of a CDATA section.

The SXP parser will invoke this method at the beginning of every CDATA section in the XML document; there will be a corresponding EndCdataSection event for every StartCdataSection event. The contents of the CDATA section will be reported as one or more CharacterData events, before the corresponding EndCdataSection event.

EndCdataSection

virtual void EndCdataSection() = 0;

Receives notification of the end of a CDATA section.

The SXP parser will invoke this method at the end of every CDATA section in the XML document; there will be a corresponding StartCdataSection event for every EndCdataSection event.

EntityReference

virtual void EntityReference(const CString &strName) = 0;

Receives notification of an entity reference.

The SXP parser will invoke this method for each entity skipped.

Parameters:
strName - the entitiy name

ProcessingInstruction

virtual void ProcessingInstruction(
    const CString &strTarget, const CString &strData) = 0;

Receives notification of a processing instruction.

The SAX parser will invoke this method once for each processing instruction found: note that processing instructions may occur before or after the main document element.

Parameters:
strTarget - the processing instruction target
strData - the processing instruction data, or the empty string if none was supplied

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

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