|
| XdmItem () |
| Default constructor.
|
|
| XdmItem (int64_t objRef) |
| XdmItem constructor to create an object which is a wrapper for a Java XdmItem object - internal use only.
|
|
| XdmItem (const XdmItem &item) |
| XdmItem copy constructor.
|
|
bool | operator== (const XdmItem &other) const |
|
virtual | ~XdmItem () |
| Destructor method for XdmItem.
|
|
virtual void | incrementRefCount () |
| Increment reference count of this XdmItem - internal use only.
|
|
virtual void | decrementRefCount () |
| Decrement reference count of this XdmItem - internal use only.
|
|
virtual bool | isAtomic () |
| Determine whether the item is an atomic value or some other type of item.
|
|
virtual bool | isNode () |
| Determine whether the item is a node or some other type of item.
|
|
virtual bool | isFunction () |
| Determine whether the item is an XDM function or some other type of item.
|
|
virtual bool | isMap () |
| Determine whether the item is an XDM map or some other type of item.
|
|
virtual bool | isArray () |
| Determine whether the item is an XDM array or some other type of item.
|
|
virtual int64_t | getUnderlyingValue () |
| Get the underlying Java XdmValue object - internal use only.
|
|
virtual const char * | getStringValue (const char *encoding=nullptr) |
| Get the string value of the item.
|
|
const char * | toString (const char *encoding=nullptr) |
| Create a string representation of the item.
|
|
virtual XdmItem * | getHead () |
| Get the first item in the sequence consisting of just this item.
|
|
XdmItem * | itemAt (int n) |
| Get the n'th item in the sequence consisting of just this item, counting from zero.
|
|
int | size () |
| Get the number of items in the sequence.
|
|
virtual XDM_TYPE | getType () |
| Get the type of this XDM value.
|
|
| XdmValue () |
| Default constructor.
|
|
| XdmValue (const XdmValue &other) |
| XdmValue copy constructor.
|
|
void | addXdmItem (XdmItem *val) |
| Add an XdmItem to the sequence.
|
|
virtual bool | operator== (const XdmValue &other) const |
|
void | addXdmItemFromUnderlyingValue (XdmItem *val) |
| Add an XdmItem to the sequence, when the sequence was returned from SaxonC - internal use only.
|
|
void | addUnderlyingValue (int64_t val) |
| Add Java XdmValue object to the sequence.
|
|
| XdmValue (int64_t val, bool arrFlag) |
| A Constructor for handling XdmArray - internal use only.
|
|
| XdmValue (int64_t val) |
| XdmValue constructor to create an object which is a wrapper for a Java XdmValue object - internal use only.
|
|
virtual | ~XdmValue () |
| Destructor method for XdmValue.
|
|
void | releaseXdmValue () |
| Deprecated: this is deprecated and a no-op, the C++ destructor handles this case.
|
|
int | getRefCount () |
| Get the number of references on this XdmValue - internal use only This method is used for internal memory management.
|
|
void | resetRelinquishedItems () |
| Reset associated reference counts on XdmItems that have been relinquished - internal use only.
|
|
void | incrementRefCountForRelinquishedValue (int i) |
| Increment the ref count for a relinquished item only once - internal use only.
|
|
The class XdmItem represents an item in a sequence, as defined by the XDM data model.
An item is either an atomic value, a node, or a function item.
An item is a member of a sequence, but it can also be considered as a sequence (of length one) in its own right. XdmItem
is a subtype of XdmValue
because every item in the XDM data model is also a value.
It cannot be assumed that every sequence of length one will be represented by an XdmItem
. It is quite possible for an XdmValue
that is not an XdmItem
to hold a singleton sequence.
Saxon provides a number of concrete subclasses of XdmItem
, namely XdmNode, XdmAtomicValue and XdmFunctionItem. Users must not attempt to create additional subclasses.
const char * XdmItem::getStringValue |
( |
const char * | encoding = nullptr | ) |
|
|
virtual |
Get the string value of the item.
For a node, this gets the string value of the node. For an atomic value, it has the same effect as casting the value to a string. For a function item, there is no string value, so an exception is thrown. In all cases the result is the same as applying the XPath string() function.
For atomic values, the result is the same as the result of calling toString
. This is not the case for nodes, where toString
returns an XML serialization of the node. The caller is responsible for memory deallocation using operator delete
.
- Parameters
-
encoding | - the encoding of the string returned. If NULL or omitted it defaults to the JVM encoding, which in most cases is UTF-8. |
- Returns
- The result of converting the item to a string.
- Exceptions
-
Reimplemented in XdmArray, XdmAtomicValue, XdmFunctionItem, and XdmNode.