Sleepycat::XmlResults.3pm

Langue: en

Version: 2008-10-21 (fedora - 05/07/09)

Section: 3 (Bibliothèques de fonctions)

NAME

XmlResults - A Perl interface to the DbXml XmlResults Class

SYNOPSIS

     use Sleepycat::DbXml;
 
     my $manager = new XmlManager();
 
     my $results = $manager->query(...);
     my $results = $manager->createResults(...);
     my $results = $manager->lookupIndex(...);
 
     my $size = $results->size() ;
     $results->reset();
     my $bool = $results->hasPrevious()
     my $bool = $results->hasNext()
 
 
     my $xmlvalue = new XmlValue ;
     while ($results->next($xmlvalue))
     {
     }
 
     my $document = new XmlDocument ;
     while ($results->next($document))
     {
     }
 
     my $scalar ;
     while ($results->next($scalar))
     {
     }
 
     my $bool = $results->peek($xmlvalue);
     my $bool = $results->peek($document);
     my $bool = $results->peek($scalar);
 
     my $bool = $results->previous($xmlvalue);
     my $bool = $results->previous($document);
     my $bool = $results->previous($scalar);
 
 

DESCRIPTION

CONFORMANCE to C++ API

The Perl interface to XMlValue is identical to the C++ API.

Constructor

There is no constructor provided for this class. An XmlResults object is returned from a number of objects within this module, including XmlManager::query, XmlManager::createResults, XmlContainer::lookupIndex, XmlValue::getAttributes and XmlQueryExpression::execute.

Methods


my $size = $results->size() ;


my $size = $results->size() ;

Returns the number of results in the result set.

my $bool = $results->hasPrevious()


my $bool = $results->hasPrevious()


my $bool = $results->hasNext()


my $bool = $results->hasNext()


$results->reset();


$results->reset();


$results->add($value);


$results->add($value);

Adds $value to the result set. The $value parameter can be either a plain perl scalar or an XmlValue object.

$results->next($xmlvalue); =head2 $results->next($document); =head2 $results->next($scalar);


$results->next($xmlvalue); =head2 $results->next($document); =head2 $results->next($scalar);

Retrieves the next result from the result set and stores it in the $v parameter.

Returns true when another result is available, and false otherwise.

How the result is stored is dependant on the type of the $v parameter. If it is either an XmlValue or XmlDocument object the result will be stored directly in the object. If it is neither an XmlValue object or an XmlDocument object, the contents os the $v parameter will be overwritten with a Perl string.

$results->peek($xmlvalue); =head2 $results->peek($document); =head2 $results->peek($scalar);


$results->peek($xmlvalue); =head2 $results->peek($document); =head2 $results->peek($scalar);

Retrieves the current result from the result set, without advancing to the next element in the set, and stores it in the $v parameter.

Returns true when a result is available, and false otherwise.

How the result is stored is dependant on the type of the $v parameter. If it is either an XmlValue or XmlDocument object the result will be stored directly in the object. If it is neither an XmlValue object or an XmlDocument object, the contents os the $v parameter will be overwritten with a Perl string.

$results->previous($xmlvalue); =head2 $results->previous($document); =head2 $results->previous($scalar);


$results->previous($xmlvalue); =head2 $results->previous($document); =head2 $results->previous($scalar);

Retrieves the previous result from the result set and stores it in the $v parameter.

Returns true when a result is available, and false otherwise.

How the result is stored is dependant on the type of the $v parameter. If it is either an XmlValue or XmlDocument object the result will be stored directly in the object. If it is neither an XmlValue object or an XmlDocument object, the contents os the $v parameter will be overwritten with a Perl string.

EXAMPLES

SEE ALSO

AUTHOR

Paul Marquess