Unicorn XML Toolkit
Version 1.50.00

Namespace Xml
Class CXpathContext

class CXpathContext: public CInterface {
public:
    CXpathContext(
        CToolkitBase *pToolkitBase,
        CXpathNodeSet *pNodeSet);
    CXpathContext(
        CToolkitBase *pToolkitBase,
        Dom::INode *pNode,
        int nCount=1,
        int nPosition=1);
    ~CXpathContext();
public:
    Dom::XNode GetCurrent();
    int GetPosition();
    int GetCount();
    void DeclarePrefix(
        const WCHAR *pszPrefix,
        const WCHAR *pszNamespaceUri);
public:
    Xpath::CContext *GetContext();
    };
typedef XInterface<CXpathContext> XXpathContext;

Encapsulates XPath contexts.

XPath contexts are used when XPath expressions ( CXpathExpr are evaluated.

As implemented, each context object provides the context node, the context position, the context size, and the namespace declaration set, all under control of the application programmer. The function library is fixed to the XPath core library, and the variable binding set is assumed empty. Therefore, it is not allowed to use functions not belonging to the XPath core library in the XPath expressions represented by CXpathExpr objects; variables are not allowed as well. (Note that this restriction applies only to XPath expressions represented by CXpathExpr objects and not to other toolkit components, which use XPath.)

Since:
1.50.00
Version:
1.50.00
Author:
Alexey Gokhberg
See Also:
CToolkitBase, Dom::INode
Constructor/Destructor Summary
CXpathContext (CToolkitBase *pToolkitBase, CXpathNodeSet *pNodeSet);
����������Constructs the XPath context from the node set.
CXpathContext (CToolkitBase *pToolkitBase, Dom::INode *pNode, int nCount=1, int nPosition=1);
����������Constructs the XPath context from the node.
~CXpathContext ();
����������Destroys the XPath context.

Function Summary
Dom::XNode GetCurrent ();
����������Returns the context node.
int GetPosition ();
����������Returns the context position.
int GetCount ();
����������Returns the context size.
void DeclarePrefix (const WCHAR *pszPrefix, const WCHAR *pszNamespaceUri);
����������Adds the pair of a prefix and a namespace URI to the namespace declaration set of this context.
Xpath::CContext�* GetContext ();
����������Returns the internal representation of XPath context encapsulated in this object.

Constructor/Destructor Detail

CXpathContext

CXpathContext(
    CToolkitBase *pToolkitBase,
    CXpathNodeSet *pNodeSet);

Constructs the XPath context from the node set.

The context node, the context position, and the context size are determined by the node set object passed as the parameter to the constructor, being set to the current node, current position and number of nodes of that node set respectively. The namespace declaration set is initially empty; namespace declarations may be added using the DeclarePrefix method. The function library is fixed the XPath core function library, and the variable binding set is empty.

Parameters:
pToolkitBase - the master toolkit base
pNodeSet - the context node set

CXpathContext

CXpathContext(
    CToolkitBase *pToolkitBase,
    Dom::INode *pNode,
    int nCount=1,
    int nPosition=1);

Constructs the XPath context from the node.

The context node, context position, and context size are passed to the constructor as parameters. The namespace declaration set is initially empty; namespace declarations may be added using the DeclarePrefix method. The function library is fixed the XPath core function library, and the variable binding set is empty.

The model of the context node must be XDM (that is, DOM nodes are not allowed).

Parameters:
pToolkitBase - the master toolkit base
pNode - the context node
nCount - the context size
nPosition - the context position

~CXpathContext

~CXpathContext();

Destroys the XPath context.

Function Detail

GetCurrent

Dom::XNode GetCurrent();

Returns the context node.

Returns:
the context node

GetPosition

int GetPosition();

Returns the context position.

Returns:
the context position

GetCount

int GetCount();

Returns the context size.

Returns:
the context size

DeclarePrefix

void DeclarePrefix(
    const WCHAR *pszPrefix,
    const WCHAR *pszNamespaceUri);

Adds the pair of a prefix and a namespace URI to the namespace declaration set of this context.

Parameters:
pszPrefix - the prefix
pszNamespaceUri - the namespace URI

GetContext

Xpath::CContext *GetContext();

Returns the internal representation of XPath context encapsulated in this object.

This method is intended mainly for the toolkit internal use.

Returns:
the internal representation of XPath context encapsulated in this object

Unicorn XML Toolkit
Version 1.50.00


This document was created using Unicorn DOC++.

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