Unicorn XML Toolkit
Version 1.00.00

Namespace Xslt
Class CExtensionStaticContext

class CExtensionStaticContext: public CInterface {
public:
    CExtensionStaticContext();
    virtual ~CExtensionStaticContext();
public:
    virtual XNode GetNode() = 0;
    virtual void CreateContent(
        const XExtensionContentType &pExtensionContentType) = 0;
    virtual bool GetAttribute(
        CString &strResult,
        const CString &strName,
        bool bRequired=false) = 0;
    virtual CString GetString(
        const CString &strName,
        const WCHAR *pszDefault=NULL,
        bool bRequired=false) = 0;
    virtual bool GetUri(
        CString &strResult,
        const CString &strName,
        bool bRequired=false) = 0;
    virtual XExpr GetExpr(
        const CString &strName,
        const WCHAR *pszDefault=NULL,
        bool bRequired=false) = 0;
    virtual XAvt GetAvt(
        const CString &strName,
        const WCHAR *pszDefault=NULL,
        bool bRequired=false) = 0;
    virtual bool GetNumber(
        double &dblResult,
        const CString &strName,
        bool bRequired=false) = 0;
    virtual XExpr ParseExpr(const CString &strSource) = 0;
    virtual XAvt ParseAvt(const CString &strSource) = 0;
    virtual void SignalError(IException *e) = 0;
    };

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

This class provides access to the relevant functionality of the stylesheet composition process. The extension static context information is used to create instances of extension elements when the stylesheet is compiled and the internal representation of the stylesheet is composed.

Every extension static context instance is associated with certain extension element in the stylesheet source, providing information required to compile part of the stylesheet rooted at this element.

Implementation of 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, CExtensionContentType, Dom::INode, Xpath::CExpr
Constructor/Destructor Summary
CExtensionStaticContext ();
����������Constructs the extension static context.
~CExtensionStaticContext ();
����������Destroys the extension static context.

Function Summary
XNode GetNode ();
����������Returns the source node for the extension element associated with this extension static context.
void CreateContent (const XExtensionContentType &pExtensionContentType);
����������Creates part of the stylesheet corresponding to the content of the extension element node associated with this extension static content.
bool GetAttribute (CString &strResult, const CString &strName, bool bRequired=false);
����������Returns the value of the given attribute on the element associated with this extension static context.
CString GetString (const CString &strName, const WCHAR *pszDefault=NULL, bool bRequired=false);
����������Returns the string representing the value of the given attribute on the element associated with this extension static context.
bool GetUri (CString &strResult, const CString &strName, bool bRequired=false);
����������Returns the URI represented by the given attribute on the element associated with this extension static context.
XExpr GetExpr (const CString &strName, const WCHAR *pszDefault=NULL, bool bRequired=false);
����������Returns the XPath expression represented by the given attribute on the element associated with this extension static context.
XAvt GetAvt (const CString &strName, const WCHAR *pszDefault=NULL, bool bRequired=false);
����������Returns the attribute value template represented by the given attribute on the element associated with this extension static context.
bool GetNumber (double &dblResult, const CString &strName, bool bRequired=false);
����������Returns the XPath number represented by the given attribute on the element associated with this extension static context.
XExpr ParseExpr (const CString &strSource);
����������Parses the XPath expression, taking in account the current internal state of the stylesheet composition process.
XAvt ParseAvt (const CString &strSource);
����������Parses the attribute value template, taking in account the current internal state of the stylesheet composition process.
void SignalError (IException *e);
����������Signals the error related to the stylesheet composition.

Constructor/Destructor Detail

CExtensionStaticContext

CExtensionStaticContext();

Constructs the extension static context.

~CExtensionStaticContext

virtual ~CExtensionStaticContext();

Destroys the extension static context.

Function Detail

GetNode

virtual XNode GetNode() = 0;

Returns the source node for the extension element associated with this extension static context.

Returns:
the source node for the extension element associated with this extension static context

CreateContent

virtual void CreateContent(
    const XExtensionContentType &pExtensionContentType) = 0;

Creates part of the stylesheet corresponding to the content of the extension element node associated with this extension static content.

Parameters:
pExtensionContentType - the extension content type which specifies the allowed content structure

GetAttribute

virtual bool GetAttribute(
    CString &strResult,
    const CString &strName,
    bool bRequired=false) = 0;

Returns the value of the given attribute on the element associated with this extension static context.

This function throws an exception if the required attribute ( bRequired is set to true ) is not present.

Parameters:
strResult - on return, the value of the given attribute on the element associated with this extension static context; unspecified if the attribute is not present
strName - the name of the attribute
bRequired - indicates whether the given attribute is required
Returns:
true if the attribute is present; false otherwise

GetString

virtual CString GetString(
    const CString &strName,
    const WCHAR *pszDefault=NULL,
    bool bRequired=false) = 0;

Returns the string representing the value of the given attribute on the element associated with this extension static context.

An optional default value is used when the attribute is not present.

This function throws an exception if the required attribute ( bRequired is set to true ) is not present, even if the default value is supplied.

Parameters:
strName - the name of the attribute
pszDefault - the default attribute value to use if the given attribute is not present; NULL means no default
bRequired - indicates whether the given attribute is required
Returns:
the string representing the value of the given attribute on the element associated with this extension static context, or the default value if the attribute is not present

GetUri

virtual bool GetUri(
    CString &strResult,
    const CString &strName,
    bool bRequired=false) = 0;

Returns the URI represented by the given attribute on the element associated with this extension static context.

Relative URI are resolved using the base URI of the element associated with this extension static context.

This function throws an exception if the required attribute ( bRequired is set to true ) is not present.

Parameters:
strResult - on return, the URI represented by the given attribute on the element associated with this extension static context; unspecified in the attribute is not present
strName - the name of the attribute
bRequired - indicates whether the given attribute is required
Returns:
true if the attribute is present; false otherwise

GetExpr

virtual XExpr GetExpr(
    const CString &strName,
    const WCHAR *pszDefault=NULL,
    bool bRequired=false) = 0;

Returns the XPath expression represented by the given attribute on the element associated with this extension static context.

An optional default value is used when the attribute is not present.

This function throws an exception if the required attribute ( bRequired is set to true ) is not present, even if the default value is supplied.

Parameters:
strName - the name of the attribute
pszDefault - the default attribute value to use if the given attribute is not present; NULL means no default
bRequired - indicates whether the given attribute is required
Returns:
the XPath expression represented by the given attribute on the element associated with this extension static content, or NULL if the attribute is not present and no default value is supplied

GetAvt

virtual XAvt GetAvt(
    const CString &strName,
    const WCHAR *pszDefault=NULL,
    bool bRequired=false) = 0;

Returns the attribute value template represented by the given attribute on the element associated with this extension static context.

An optional default value is used when the attribute is not present.

This function throws an exception if the required attribute ( bRequired is set to true ) is not present, even if the default value is supplied.

Parameters:
strName - the name of the attribute
pszDefault - the default attribute value to use if the given attribute is not present; NULL means no default
bRequired - indicates whether the given attribute is required
Returns:
the attribute value template represented by the given attribute on the element associated with this extension static content, or NULL if the attribute is not present and no default value is supplied

GetNumber

virtual bool GetNumber(
    double &dblResult,
    const CString &strName,
    bool bRequired=false) = 0;

Returns the XPath number represented by the given attribute on the element associated with this extension static context.

This function throws an exception if the required attribute ( bRequired is set to true ) is not present.

Parameters:
dblResult - on return, the XPath number represented by the given attribute on the element associated with this extension static content; unspecified if the attribute is not present
strName - the name of the attribute
bRequired - indicates whether the given attribute is required
Returns:
true if the given attribute is present; false otherwise

ParseExpr

virtual XExpr ParseExpr(const CString &strSource) = 0;

Parses the XPath expression, taking in account the current internal state of the stylesheet composition process.

Parameters:
strSource - the expression source
Returns:
the expression obtained as the result of parsing

ParseAvt

virtual XAvt ParseAvt(const CString &strSource) = 0;

Parses the attribute value template, taking in account the current internal state of the stylesheet composition process.

Parameters:
strSource - the attribute value template source
Returns:
the attribute value template obtained as the result of parsing

SignalError

virtual void SignalError(IException *e) = 0;

Signals the error related to the stylesheet composition.

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.