Unicorn XML Toolkit
Version 1.00.00

Namespace Xpath
Class CDataSet

class CDataSet: public CInterface {
public:
    CDataSet();
    virtual ~CDataSet();
public:
    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;
    };

The abstract interface for handling element identifiers and comparing relative positions of nodes.

It is assumed that every application or library that employs classes of the Xpath namespace will supply the class derived from CDataSet to provide the appropriate implementation of corresponding features.

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

Function Summary
bool GetElementId (const XNode &pNode, CString &strId);
����������Returns the identifier of the given element node.
XNode GetElementById (const XDocument &pDocument, const CString &strId);
����������Looks up an element node having the given identifier in the given document.
int GetRelativePosition (const XNode &pNode1, const XNode &pNode2);
����������Returns the relative position of two nodes according to the ordering specified by this data set.

Constructor/Destructor Detail

CDataSet

CDataSet();

Constructs the data set.

~CDataSet

virtual ~CDataSet();

Destroys the data set.

Function Detail

GetElementId

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

Returns the identifier of the given element node.

Parameters:
pNode - the element node
strId - on return, the value of the element identifier; unspecified, if the element has no identifier
Returns:
true if the given element has an identifier; false otherwise

GetElementById

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

Looks up an element node having the given identifier in the given document.

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

GetRelativePosition

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

Returns the relative position of two nodes according to the ordering specified by this data set.

The data set 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

Unicorn XML Toolkit
Version 1.00.00


This document was created using Unicorn DOC++.

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