Unicorn XML Toolkit
Version 1.00.00

Namespace Xslt
Class CDataSet

class CDataSet: public CInterface {
public:
    CDataSet();
    virtual ~CDataSet();
public:
    virtual void SetIdHandler(const XIdHandler &pIdHandler) = 0;
    virtual void AddKey(
        const CString &strNamespaceUri,
        const CString &strLocalName,
        const XKeyHandler &pKeyHandler) = 0;
    virtual void AddDocument(const XDocument &pDocument) = 0;
    virtual void RemoveDocument(const XDocument &pDocument) = 0;
    virtual bool GetElementId(
        const XNode &pNode, CString &strId) = 0;
    virtual XNode GetElementById(
        const XDocument &pDocument, const CString &strId) = 0;
    virtual int GetRelativePosition(
        const XNode &pNode1, const XNode &pNode2) = 0;
    virtual bool MatchKey(
        const XNode &pNode,
        const CString &strNamespaceUri,
        const CString &strLocalName,
        const CString &strValue) = 0;
    virtual XNodeSet Select(
        const XDocument &pDocument,
        const CString &strNamespaceUri,
        const CString &strLocalName,
        const CString &strValue) = 0;
    };

The abstract interface for handling XML element identifiers and XSLT keys, tracing open XML documents, and comparing relative positions of nodes.

Since:
1.00.00
Version:
1.00.00
Author:
Alexey Gokhberg
See Also:
CIdHandler, CKeyHandler, Dom::INode, Dom::IDocument
Constructor/Destructor Summary
CDataSet ();
����������Constructs the data set.
~CDataSet ();
����������Destroys the data set.

Function Summary
void SetIdHandler (const XIdHandler &pIdHandler);
����������Sets the identifier handler for this data set.
void AddKey (const CString &strNamespaceUri, const CString &strLocalName, const XKeyHandler &pKeyHandler);
����������Adds the named key handler to the list of key handlers associated with this data set.
void AddDocument (const XDocument &pDocument);
����������Adds the document to the list of open XML documents associated with this data set.
void RemoveDocument (const XDocument &pDocument);
����������Removes the document from the list of open XML documents associated with this data set.
bool GetElementId (const XNode &pNode, CString &strId);
����������Returns the element identifier of the given node.
XNode GetElementById (const XDocument &pDocument, const CString &strId);
����������Looks up a node with the given element identifier in the given document.
int GetRelativePosition (const XNode &pNode1, const XNode &pNode2);
����������Returns the relative position of two nodes.
bool MatchKey (const XNode &pNode, const CString &strNamespaceUri, const CString &strLocalName, const CString &strValue);
����������Matches the given node against the given named key.
XNodeSet Select (const XDocument &pDocument, const CString &strNamespaceUri, const CString &strLocalName, const CString &strValue);
����������Selects all nodes of the given document that have the given value of the given key.

Constructor/Destructor Detail

CDataSet

CDataSet();

Constructs the data set.

~CDataSet

virtual ~CDataSet();

Destroys the data set.

Function Detail

SetIdHandler

virtual void SetIdHandler(const XIdHandler &pIdHandler) = 0;

Sets the identifier handler for this data set.

Parameters:
pIdHandler - the identifier handler

AddKey

virtual void AddKey(
    const CString &strNamespaceUri,
    const CString &strLocalName,
    const XKeyHandler &pKeyHandler) = 0;

Adds the named key handler to the list of key handlers associated with this data set.

Parameters:
strNamespaceUri - the namespace URI of the key handler
strLocalName - the local name of the key handler
pKeyHandler - the key handler

AddDocument

virtual void AddDocument(const XDocument &pDocument) = 0;

Adds the document to the list of open XML documents associated with this data set.

Parameters:
pDocument - the document

RemoveDocument

virtual void RemoveDocument(const XDocument &pDocument) = 0;

Removes the document from the list of open XML documents associated with this data set.

Parameters:
pDocument - the document to remove

GetElementId

virtual bool GetElementId(
    const XNode &pNode, CString &strId) = 0;

Returns the element identifier of the given node.

Parameters:
pNode - the node
strId - on return, the element identifier if the given node is an element and the identifier is available; unspecified otherwise
Returns:
true if the given node is an element and the identifier is available; false otherwise

GetElementById

virtual XNode GetElementById(
    const XDocument &pDocument, const CString &strId) = 0;

Looks up a node with the given element identifier in the given document.

Parameters:
pDocument - the document
strId - the element identifier to look up
Returns:
the node in the given document having the given element identifier, or NULL if there is no such node

GetRelativePosition

virtual int GetRelativePosition(
    const XNode &pNode1, const XNode &pNode2) = 0;

Returns the relative position of two nodes.

The XSLT engine defines global order for all nodes of all open documents in the data set. Within every single document this global order is equivalent to the document order defined by XPath.

The relative position of two nodes is a negative integer if the first node precedes the second node, a positive integer if the first node follows the second node, and zero if two nodes are equal.

Parameters:
pNode1 - the first node
pNode2 - the second node
Returns:
the relative position of given nodes

MatchKey

virtual bool MatchKey(
    const XNode &pNode,
    const CString &strNamespaceUri,
    const CString &strLocalName,
    const CString &strValue) = 0;

Matches the given node against the given named key.

Parameters:
pNode - the node to match
strNamespaceUri - the namespace URI of the key
strLocalName - the local name of the key
strValue - the key value
Returns:
true if the given node has the given value of the given key; false otherwise

Select

virtual XNodeSet Select(
    const XDocument &pDocument,
    const CString &strNamespaceUri,
    const CString &strLocalName,
    const CString &strValue) = 0;

Selects all nodes of the given document that have the given value of the given key.

Parameters:
pDocument - the document
strNamespaceUri - the namespace URI of the key
strLocalName - the local name of the key
strValue - the key value
Returns:
the node-set containing all selected nodes in the document order

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

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