Unicorn XML Toolkit
Version 1.00.00

Namespace Xslt
Class CInputHandler

class CInputHandler: public CInterface {
public:
    CInputHandler();
    virtual ~CInputHandler();
public:
    virtual void CreateDocument(
        const XDocument &pDocument, 
        const XLocationHandler &pLocationHandler,
        const XSpaceHandler &pSpaceHandler,
        const XDtdHandler &pDtdHandler) = 0;
    virtual void CreateDocument(
        const XDocument &pDocument,
        const CString &strUri, 
        const XLocationHandler &pLocationHandler,
        const XSpaceHandler &pSpaceHandler,
        const XDtdHandler &pDtdHandler) = 0;
    virtual void CreateDocument(
        const XDocument &pDocument,
        const Sax::XXmlStream &pStream, 
        const XLocationHandler &pLocationHandler,
        const XSpaceHandler &pSpaceHandler,
        const XDtdHandler &pDtdHandler) = 0;
    virtual XNodeSet GetFragment(
        const XDocument &pDocument,
        const CString &strUri) = 0;
    };

The abstract interface for creating documents from various sources.

At least one derived class must be supplied to provide implementation of this interface. The default implementation is provided via the CBasicInputHandler class.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CSpaceHandler, CLocationHandler, Sxp::IDtdHandler, Sax::CXmlStream
Constructor/Destructor Summary
CInputHandler ();
����������Constructs the input handler.
~CInputHandler ();
����������Destroys the input handler.

Function Summary
void CreateDocument (const XDocument &pDocument, const XLocationHandler &pLocationHandler, const XSpaceHandler &pSpaceHandler, const XDtdHandler &pDtdHandler);
����������Creates a document from an XDM source.
void CreateDocument (const XDocument &pDocument, const CString &strUri, const XLocationHandler &pLocationHandler, const XSpaceHandler &pSpaceHandler, const XDtdHandler &pDtdHandler);
����������Creates a document from an URI.
void CreateDocument (const XDocument &pDocument, const Sax::XXmlStream &pStream, const XLocationHandler &pLocationHandler, const XSpaceHandler &pSpaceHandler, const XDtdHandler &pDtdHandler);
����������Creates a document from an XML stream.
XNodeSet GetFragment (const XDocument &pDocument, const CString &strUri);
����������Fetches the document fragment from the given document based on the given URI.

Constructor/Destructor Detail

CInputHandler

CInputHandler();

Constructs the input handler.

~CInputHandler

virtual ~CInputHandler();

Destroys the input handler.

Function Detail

CreateDocument

virtual void CreateDocument(
    const XDocument &pDocument, 
    const XLocationHandler &pLocationHandler,
    const XSpaceHandler &pSpaceHandler,
    const XDtdHandler &pDtdHandler) = 0;

Creates a document from an XDM source.

This function receives the XDM document (which must support XDM extensions) and modifies this document in place. Text nodes containing whitespace characters only are stripped as required by XSLT, using the space handler supplied as the function parameter. Adjacent text nodes are merged.

This is a deprecated function, not to be used in new applications.

Parameters:
pDocument - the source XDM document, will be modified in place
pLocationHandler - unused, must be set to NULL
pSpaceHandler - the space handler to control the whitespace stripping process
pDtdHandler - unused, must be set to NULL

CreateDocument

virtual void CreateDocument(
    const XDocument &pDocument,
    const CString &strUri, 
    const XLocationHandler &pLocationHandler,
    const XSpaceHandler &pSpaceHandler,
    const XDtdHandler &pDtdHandler) = 0;

Creates a document from an URI.

The empty document must be passed as a parameter to this function. On return, this document receives content obtained by parsing XML data located at the given URI. The whitespace is stripped as required by XSLT.

The DTD handler required as the parameter of this function is supplied by the XSLT engine. Tookit users are not required to provide a specific implementation of the DTD handler.

Parameters:
pDocument - the document to be created
strUri - the source URI
pLocationHandler - the location handler to register locations of document nodes
pSpaceHandler - the space handler to control the whitespace stripping process
pDtdHandler - the SXP DTD handler to handle DTD-related information relevant for XSLT processing

CreateDocument

virtual void CreateDocument(
    const XDocument &pDocument,
    const Sax::XXmlStream &pStream, 
    const XLocationHandler &pLocationHandler,
    const XSpaceHandler &pSpaceHandler,
    const XDtdHandler &pDtdHandler) = 0;

Creates a document from an XML stream.

The empty document must be passed as a parameter to this function. On return, this document receives content obtained from the given XML stream. The whitespace is stripped as required by XSLT.

Parameters:
pDocument - the document to be created
pStream - the source XML stream
pLocationHandler - the location handler to register locations of document nodes
pSpaceHandler - the space handler to control the whitespace stripping process
pDtdHandler - unused; must be set to NULL

GetFragment

virtual XNodeSet GetFragment(
    const XDocument &pDocument,
    const CString &strUri) = 0;

Fetches the document fragment from the given document based on the given URI.

Parameters:
pDocument - the source document
strUri - the document fragment URI (might contain the fragment identifier)
Returns:
the node-set containing the fetched document fragment

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

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