Unicorn XML Toolkit
Version 1.50.00

Namespace Xml
Class CXpathNodeSet

class CXpathNodeSet: public CInterface {
public:
    CXpathNodeSet(Xpath::CNodeSet *pNodeSet);
    CXpathNodeSet(const CXpathValue &value);
    ~CXpathNodeSet();
public:
    Dom::XNode GetCurrent();
    int GetPosition();
    int GetCount();
    void Reset();
    void Next();
    CString ToString();
public:
    Xpath::CNodeSet *GetNodeSet();
    Xpath::CIterator *GetIterator();
    };
typedef XInterface<CXpathNodeSet> XXpathNodeSet;

Encapsulates XPath node sets.

Objects of this class provide the facility for iterating through node sets. That is, each node set object has the current node and the current position properties, and provides interface for iterating to the next node in the node set.

Objects of this class are usually constructed from XPath values ( CXpathValue ).

Since:
1.50.00
Version:
1.50.00
Author:
Alexey Gokhberg
See Also:
CXpathValue, Dom::INode
Constructor/Destructor Summary
CXpathNodeSet (Xpath::CNodeSet *pNodeSet);
����������Constructs the node set from the internal representation.
CXpathNodeSet (const CXpathValue &value);
����������Construct the node set from the given source XPath value
~CXpathNodeSet ();
����������Destroys the node set.

Function Summary
Dom::XNode GetCurrent ();
����������Returns the current node of this node set.
int GetPosition ();
����������Returns the current position of this node set.
int GetCount ();
����������Returns the number of nodes in this node set.
void Reset ();
����������Resets the iterator associated with this node set.
void Next ();
����������Iterates to the next node in this node set.
CString ToString ();
����������Returns the string value of this node set.
Xpath::CNodeSet�* GetNodeSet ();
����������Returns the internal representation of XPath node set encapsulated in this object.
Xpath::CIterator�* GetIterator ();
����������Returns the internal representation of XPath node set iterator encapsulated in this object.

Constructor/Destructor Detail

CXpathNodeSet

CXpathNodeSet(Xpath::CNodeSet *pNodeSet);

Constructs the node set from the internal representation.

This constructor is intended mainly for the toolkit internal use.

Parameters:
pNodeSet - the internal representation of the XPath node set to be encapsulated in this object

CXpathNodeSet

CXpathNodeSet(const CXpathValue &value);

Construct the node set from the given source XPath value

It is an error if this value does not represent a node set (that is, has the type other than CXpathValue::typeNodeSet ).

Parameters:
value - the source XPath value

~CXpathNodeSet

~CXpathNodeSet();

Destroys the node set.

Function Detail

GetCurrent

Dom::XNode GetCurrent();

Returns the current node of this node set.

Originally the current node is set to the first node in the node set, or to NULL is the node set is empty. Each time the Iterate method is invoked, the current node is set to the next sibling of the previously set current node, or to NULL is there is no next sibling.

The model of the current node is always XDM (that is, XPath document model.

Returns:
the current node of the node set, or NULL if there is no current node.

GetPosition

int GetPosition();

Returns the current position of this node set.

The number of the first position in the node set is 1 . Originally the current position is set to 1 is the node set is not empty, or to 0 otherwise. Each time the Iterate method is invoked, the current position is incremented by one unless the current node becomes NULL (that is, end of the node set is reached), in which case the current position is set to 0 .

Returns:
the current position

GetCount

int GetCount();

Returns the number of nodes in this node set.

Returns:
the number of nodes in this node set

Reset

void Reset();

Resets the iterator associated with this node set.

The current node is reset to the first node of this node set, or to NULL if the node set is empty. The current position is reset to 1 if the node set is not empty, and to 0 otherwise.

Next

void Next();

Iterates to the next node in this node set.

The current node and the current position are changed as described above.

ToString

CString ToString();

Returns the string value of this node set.

The string value of the node set is a string value of its first node, or the empty string if the node set is empty.

Returns:
the string value of this node set

GetNodeSet

Xpath::CNodeSet *GetNodeSet();

Returns the internal representation of XPath node set encapsulated in this object.

This method is intended mainly for the toolkit internal use.

Returns:
the internal representation of XPath node set encapsulated in this object

GetIterator

Xpath::CIterator *GetIterator();

Returns the internal representation of XPath node set iterator encapsulated in this object.

This method is intended mainly for the toolkit internal use.

Returns:
the internal representation of XPath node set iterator 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.