#include <XPath2Result.hpp>
Public Types | |
Public Constants | |
enum | ResultType { FIRST_RESULT = 100, ITERATOR_RESULT = 101, SNAPSHOT_RESULT = 102 } |
Public Member Functions | |
Functions introduced in DOM Level 3 | |
virtual ResultType | getResultType () const=0 |
Returns the result type of this result. | |
virtual bool | isNode () const=0 |
Returns true if the result has a current result and the value is a node. | |
virtual const xercesc::DOMTypeInfo * | getTypeInfo () const=0 |
Returns the DOM type info of the current result node or value. | |
virtual double | asDouble () const=0 |
Conversion of the current result to double. | |
virtual int | asInt () const=0 |
Conversion of the current result to int. | |
virtual const XMLCh * | asString () const=0 |
Conversion of the current result to string. | |
virtual bool | asBoolean () const=0 |
Conversion of the current result to boolean. | |
virtual const xercesc::DOMNode * | asNode () const=0 |
Retrieve the current node value. | |
virtual bool | getInvalidIteratorState () const=0 |
Signifies that the iterator has become invalid. | |
virtual unsigned long | getSnapshotLength () const=0 |
The number of items in the result snapshot. | |
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. | |
virtual bool | snapshotItem (unsigned long index)=0 |
Sets the current result to the indexth item in the snapshot collection. | |
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. |
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.
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.
virtual XPath2Result::~XPath2Result | ( | ) | [inline, virtual] |
Destructor.
XPath2Result::XPath2Result | ( | ) | [inline, protected] |
virtual XPath2Result::~XPath2Result | ( | ) | [inline, virtual] |
Destructor.
XPath2Result::XPath2Result | ( | ) | [inline, protected] |
virtual ResultType XPath2Result::getResultType | ( | ) | const [pure virtual] |
Returns the result type of this result.
virtual bool XPath2Result::isNode | ( | ) | const [pure virtual] |
Returns true if the result has a current result and the value is a node.
virtual const xercesc:: DOMTypeInfo* XPath2Result::getTypeInfo | ( | ) | const [pure virtual] |
Returns the DOM type info of the current result node or value.
virtual double XPath2Result::asDouble | ( | ) | 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.
XPathException | TYPE_ERR: raised if current result cannot be properly converted to double. | |
DOMException | INVALID_STATE_ERR: There is no current result in the result. |
virtual int XPath2Result::asInt | ( | ) | const [pure virtual] |
Conversion of the current result to int.
XPathException | TYPE_ERR: raised if current result cannot be properly converted to int. | |
DOMException | INVALID_STATE_ERR: There is no current result in the result. |
virtual const XMLCh* XPath2Result::asString | ( | ) | const [pure virtual] |
Conversion of the current result to string.
XPathException | TYPE_ERR: raised if current result cannot be properly converted to string. | |
DOMException | INVALID_STATE_ERR: There is no current result in the result. |
virtual bool XPath2Result::asBoolean | ( | ) | const [pure virtual] |
Conversion of the current result to boolean.
XPathException | TYPE_ERR: raised if cannot be properly converted to boolean. | |
DOMException | INVALID_STATE_ERR: There is no current result in the result. |
virtual const xercesc:: DOMNode* XPath2Result::asNode | ( | ) | const [pure virtual] |
Retrieve the current node value.
XPathException | TYPE_ERR: raised if current result is not a node. | |
DOMException | INVALID_STATE_ERR: There is no current result in the result. |
virtual bool XPath2Result::getInvalidIteratorState | ( | ) | const [pure virtual] |
Signifies that the iterator has become invalid.
virtual unsigned long XPath2Result::getSnapshotLength | ( | ) | const [pure virtual] |
The number of items in the result snapshot.
Valid values for snapshotItem indices are 0 to snapshotLength-1 inclusive.
XPathException | TYPE_ERR: raised if resultType is not SNAPSHOT_RESULT. |
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.
XPathException | TYPE_ERR: raised if resultType is not ITERATOR_RESULT. | |
DOMException | INVALID_STATE_ERR: The document has been mutated since the result was returned. |
virtual bool XPath2Result::snapshotItem | ( | unsigned long | index | ) | [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.
index | of type unsigned long - Index into the snapshot collection. |
XPathException | TYPE_ERR: raised if resultType is not SNAPSHOT_RESULT. |
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.