SourceForge.net Logo
List of all members
XPath2Result Class Referenceabstract

The XPathResult2 interface represents the result of the evaluation of an XPath 2.0 expression within the context of a particular node. More...

#include <XPath2Result.hpp>

Public Types

Public Constants
enum  ResultType { FIRST_RESULT = 100, ITERATOR_RESULT = 101, SNAPSHOT_RESULT = 102 }
 

Public Member Functions

Destructor
virtual ~XPath2Result ()
 Destructor. More...
 
Functions introduced in DOM Level 3
virtual ResultType getResultType () const =0
 Returns the result type of this result. More...
 
virtual bool isNode () const =0
 Returns true if the result has a current result and the value is a node. More...
 
virtual const
xercesc::DOMTypeInfo
getTypeInfo () const =0
 Returns the DOM type info of the current result node or value. More...
 
virtual double getNumberValue () const =0
 Conversion of the current result to double. More...
 
virtual int getIntegerValue () const =0
 Conversion of the current result to int. More...
 
virtual const XMLCh * getStringValue () const =0
 Conversion of the current result to string. More...
 
virtual bool getBooleanValue () const =0
 Conversion of the current result to boolean. More...
 
virtual xercesc::DOMNodegetNodeValue () const =0
 Retrieve the current node value. More...
 
virtual bool getInvalidIteratorState () const =0
 Signifies that the iterator has become invalid. More...
 
virtual size_t getSnapshotLength () const =0
 The number of items in the result snapshot. More...
 
virtual bool iterateNext ()=0
 Iterates and returns true if the current result is the next item from the sequence or false if there are no more items. More...
 
virtual bool snapshotItem (size_t)=0
 Sets the current result to the indexth item in the snapshot collection. More...
 
Non-standard Extension
virtual void release ()=0
 Called to indicate that this object (and its associated children) is no longer in use and that the implementation may relinquish any resources associated with it and its associated children. More...
 

Protected Member Functions

Hidden constructors
 XPath2Result ()
 

Detailed Description

The XPathResult2 interface represents the result of the evaluation of an XPath 2.0 expression within the context of a particular node.

Since evaluation of an XPath 2.0 expression can result in various result types, this object makes it possible to discover and manipulate the type and value of the result.

Since
DOM Level 3

Member Enumeration Documentation

FIRST_RESULT
The result is a sequence as defined by XPath 2.0 and will be accessed as a single current value or there will be no current value if the sequence is empty. Document modification does not invalidate the value, but may mean that the result no longer corresponds to the current document. This is a convenience that permits optimization since the implementation can stop once the first item in the resulting sequence has been found. If there is more than one item in the actual result, the single item returned might not be the first in document order.

ITERATOR_RESULT
The result is a sequence as defined by XPath 2.0 that will be accessed iteratively. Document modification invalidates the iteration.

SNAPSHOT_RESULT
The result is a sequence as defined by XPath 2.0 that will be accessed as a snapshot list of values. Document modification does not invalidate the snapshot but may mean that reevaluation would not yield the same snapshot and any items in the snapshot may have been altered, moved, or removed from the document.

Enumerator
FIRST_RESULT 
ITERATOR_RESULT 
SNAPSHOT_RESULT 

Constructor & Destructor Documentation

virtual XPath2Result::~XPath2Result ( )
inlinevirtual

Destructor.

XPath2Result::XPath2Result ( )
inlineprotected

Member Function Documentation

virtual bool XPath2Result::getBooleanValue ( ) const
pure virtual

Conversion of the current result to boolean.

Returns
asBoolean of type boolean, readonly
Exceptions
XPathExceptionTYPE_ERR: raised if cannot be properly converted to boolean.
DOMExceptionINVALID_STATE_ERR: There is no current result in the result.
virtual int XPath2Result::getIntegerValue ( ) const
pure virtual

Conversion of the current result to int.

Returns
asInt of type int, readonly
Exceptions
XPathExceptionTYPE_ERR: raised if current result cannot be properly converted to int.
DOMExceptionINVALID_STATE_ERR: There is no current result in the result.
virtual bool XPath2Result::getInvalidIteratorState ( ) const
pure virtual

Signifies that the iterator has become invalid.

Returns
invalidIteratorState of type boolean, readonly
virtual xercesc:: DOMNode* XPath2Result::getNodeValue ( ) const
pure virtual

Retrieve the current node value.

Returns
asNode of type Node, readonly
Exceptions
XPathExceptionTYPE_ERR: raised if current result is not a node.
DOMExceptionINVALID_STATE_ERR: There is no current result in the result.
virtual double XPath2Result::getNumberValue ( ) const
pure virtual

Conversion of the current result to double.

If the native double type of the DOM binding does not directly support the exact IEEE 754 result of the XPath expression, then it is up to the definition of the binding to specify how the XPath number is converted to the native binding number.

Returns
asDouble of type double, readonly
Exceptions
XPathExceptionTYPE_ERR: raised if current result cannot be properly converted to double.
DOMExceptionINVALID_STATE_ERR: There is no current result in the result.
virtual ResultType XPath2Result::getResultType ( ) const
pure virtual

Returns the result type of this result.

Returns
ResultType A code representing the type of this result, as defined by the type constants.
virtual size_t XPath2Result::getSnapshotLength ( ) const
pure virtual

The number of items in the result snapshot.

Valid values for snapshotItem indices are 0 to snapshotLength-1 inclusive.

Returns
snapshotLength of type size_t, readonly
Exceptions
XPathExceptionTYPE_ERR: raised if resultType is not SNAPSHOT_RESULT.
virtual const XMLCh* XPath2Result::getStringValue ( ) const
pure virtual

Conversion of the current result to string.

Returns
asString of type DOMString, readonly
Exceptions
XPathExceptionTYPE_ERR: raised if current result cannot be properly converted to string.
DOMExceptionINVALID_STATE_ERR: There is no current result in the result.
virtual const xercesc:: DOMTypeInfo* XPath2Result::getTypeInfo ( ) const
pure virtual

Returns the DOM type info of the current result node or value.

Returns
typeInfo of type TypeInfo, readonly
virtual bool XPath2Result::isNode ( ) const
pure virtual

Returns true if the result has a current result and the value is a node.

Returns
isNode of type boolean, readonly
virtual bool XPath2Result::iterateNext ( )
pure virtual

Iterates and returns true if the current result is the next item from the sequence or false if there are no more items.

Returns
boolean True if the current result is the next item from the sequence or false if there are no more items.
Exceptions
XPathExceptionTYPE_ERR: raised if resultType is not ITERATOR_RESULT.
DOMExceptionINVALID_STATE_ERR: The document has been mutated since the result was returned.
virtual void XPath2Result::release ( )
pure virtual

Called to indicate that this object (and its associated children) is no longer in use and that the implementation may relinquish any resources associated with it and its associated children.

Access to a released object will lead to unexpected result.

virtual bool XPath2Result::snapshotItem ( size_t  )
pure virtual

Sets the current result to the indexth item in the snapshot collection.

If index is greater than or equal to the number of items in the list, this method returns false. Unlike the iterator result, the snapshot does not become invalid, but may not correspond to the current document if it is mutated.

Parameters
indexof type size_t - Index into the snapshot collection.
Returns
boolean True if the current result is the next item from the sequence or false if there are no more items.
Exceptions
XPathExceptionTYPE_ERR: raised if resultType is not SNAPSHOT_RESULT.

The documentation for this class was generated from the following file: