Unicorn XML Toolkit
Version 1.00.00

Namespace Xslt
Class CExtensionContext

class CExtensionContext: public CInterface {
public:
    CExtensionContext();
    virtual ~CExtensionContext();
public:
    virtual XExtensionContext CreateExtensionContext() = 0;
    virtual XExtensionContext CreateExtensionContext(
        const XIterator &pIterator) = 0;
    virtual XTopLevelExtensionContext 
        GetTopLevelExtensionContext() = 0;
    virtual void InstantiateContent(int nType) = 0;
    virtual XExprContext CreateExprContext() = 0;
    virtual XValue EvaluateExpr(const XExpr &pExpr) = 0;
    virtual CString EvaluateAvt(const XAvt &pAvt) = 0;
    virtual bool ResolveUri(
        const CString &strUri, CString &strResult) = 0;
    virtual XOutputHandler GetOutputHandler() = 0;
    virtual XXsltImplementation GetXsltImplementation() = 0;
    virtual void OutputValue(
        const XValue &pValue, bool bSourceNamespaces) = 0;
    virtual XValue CreateResultTreeFragment(
        const XNodeSet &pNodeSet, bool bSourceNamespaces) = 0;
    virtual void SignalWarning(IException *e) = 0;
    virtual void SignalError(IException *e) = 0;
    };

The abstract interface to the run-time information related to the extension element.

This class provides access to the relevant functionality of the element instantiation process. The extension context information is used when the XSLT processor performs instiation of extension elements (see CExtensionElement::Instantiate ).

Every extension context is associated with certain extension stylesheet element (called here the context stylesheet element). Furthermore, every extension context is associated with certain node-set itetator (called here the context iterator), which iterates through the node-set containing nodes from one or more source documents.

The implementation the interface defined by this class is supplied by the toolkit; toolkit users do not need to implement this interface.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CAvt, CTopLevelExtensionContext, CXsltImplementation, COutputHandler, Xpath::CNodeSet, Xpath::CIterator, Xpath::CValue, Xpath::CContext, Xpath::CExpr
Constructor/Destructor Summary
CExtensionContext ();
����������Constructs the extension context.
~CExtensionContext ();
����������Destroys the extension context.

Function Summary
XExtensionContext CreateExtensionContext ();
����������Creates the clone of this extension context.
XExtensionContext CreateExtensionContext (const XIterator &pIterator);
����������Creates the clone of this extension context; associates the given node-set iterator with the newly created extension context.
XTopLevelExtensionContext GetTopLevelExtensionContext ();
����������Returns the top-level extension context associated with this extension context.
void InstantiateContent (int nType);
����������Instantiates elements of the given content type from the content of the stylesheet element associated with this extension context.
XExprContext CreateExprContext ();
����������Creates the Xpath expression context based on this extension context.
XValue EvaluateExpr (const XExpr &pExpr);
����������Evaluates the XPath expression in this extension context.
CString EvaluateAvt (const XAvt &pAvt);
����������Evaluates the attribute value template in this extension context.
bool ResolveUri (const CString &strUri, CString &strResult);
����������Resolves the URI in this extension context.
XOutputHandler GetOutputHandler ();
����������Returns the output handler associated with this extension context.
XXsltImplementation GetXsltImplementation ();
����������Returns the XSLT implementation associated with this extension context.
void OutputValue (const XValue &pValue, bool bSourceNamespaces);
����������Outputs the given value using the output handler associated with this extension context.
XValue CreateResultTreeFragment (const XNodeSet &pNodeSet, bool bSourceNamespaces);
����������Creates the result tree fragment from the source node-set using this extension context.
void SignalWarning (IException *e);
����������Signals the runtime warning.
void SignalError (IException *e);
����������Signals the runtime error.

Constructor/Destructor Detail

CExtensionContext

CExtensionContext();

Constructs the extension context.

~CExtensionContext

virtual ~CExtensionContext();

Destroys the extension context.

Function Detail

CreateExtensionContext

virtual XExtensionContext CreateExtensionContext() = 0;

Creates the clone of this extension context.

Returns:
the newly created clone of this extension context

CreateExtensionContext

virtual XExtensionContext CreateExtensionContext(
    const XIterator &pIterator) = 0;

Creates the clone of this extension context; associates the given node-set iterator with the newly created extension context.

Parameters:
pIterator - the node-set iterator to associate with the newly created extension context
Returns:
the newly created clone of this extension context

GetTopLevelExtensionContext

virtual XTopLevelExtensionContext 
    GetTopLevelExtensionContext() = 0;

Returns the top-level extension context associated with this extension context.

Returns:
the top-level extension context associated with this extension context

InstantiateContent

virtual void InstantiateContent(int nType) = 0;

Instantiates elements of the given content type from the content of the stylesheet element associated with this extension context.

Content type codes are assigned to content elements by the attached instances of the CExtensionContentType class. Every content type specifies one or more sections in the extension element content. Every section can be instantiated independently.

For example, the extension element may have two content sections, one providing parameters of this element, and another representing the list of contained instructions. Two content types must be defined by the corresponding CExtensionElementType instance for this element.

Parameters:
nType - the content type code

CreateExprContext

virtual XExprContext CreateExprContext() = 0;

Creates the Xpath expression context based on this extension context.

Returns:
the newly created XPath expression context, based on this extension context

EvaluateExpr

virtual XValue EvaluateExpr(const XExpr &pExpr) = 0;

Evaluates the XPath expression in this extension context.

Parameters:
pExpr - the XPath expression to evaluate
Returns:
the XPath value obtained as the result of evaluation

EvaluateAvt

virtual CString EvaluateAvt(const XAvt &pAvt) = 0;

Evaluates the attribute value template in this extension context.

Parameters:
pAvt - the attribute value template to evaluate
Returns:
the string value obtained as the result of evaluation

ResolveUri

virtual bool ResolveUri(
    const CString &strUri, CString &strResult) = 0;

Resolves the URI in this extension context.

Relative URI are resolved using the base URI of the stylesheet element associated with this extension context; absolute URI are returned unmodified.

Parameters:
strUri - the URI to resolve
strResult - on return, the resolved URI; unspecified if URI resolution failed
Returns:
true if the source URI was successfully resolved; false otherwise

GetOutputHandler

virtual XOutputHandler GetOutputHandler() = 0;

Returns the output handler associated with this extension context.

Returns:
the output handler associated with this extension context

GetXsltImplementation

virtual XXsltImplementation GetXsltImplementation() = 0;

Returns the XSLT implementation associated with this extension context.

Returns:
the XSLT implementation associated with this extension context

OutputValue

virtual void OutputValue(
    const XValue &pValue, bool bSourceNamespaces) = 0;

Outputs the given value using the output handler associated with this extension context.

Parameters:
pValue - the value to output
bSourceNamespaces - if the source value represents a node-set, indicates, whether the contained nodes support XDM extensions (in particular, whether the namespace declarations in scope on the element nodes are represented as XDM extension namespace nodes)

CreateResultTreeFragment

virtual XValue CreateResultTreeFragment(
    const XNodeSet &pNodeSet, bool bSourceNamespaces) = 0;

Creates the result tree fragment from the source node-set using this extension context.

Parameters:
pNodeSet - the source node-set
bSourceNamespaces - indicates, whether the nodes in the source node-set support XDM extensions (in particular, whether the namespace declarations in scope on the element nodes are represented as XDM extension namespace nodes)
Returns:
the newly created result tree fragment

SignalWarning

virtual void SignalWarning(IException *e) = 0;

Signals the runtime warning.

Parameters:
e - the exception which describes the warning

SignalError

virtual void SignalError(IException *e) = 0;

Signals the runtime error.

Parameters:
e - the exception which describes the error

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

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