net.sf.saxon.s9api
Class XdmValue
java.lang.Objectnet.sf.saxon.s9api.XdmValue
- Iterable
public class XdmValue
extends java.lang.Object
implements Iterable
An value in the XDM data model. A value is a sequence of zero or more items,
each item being either an atomic value or a node.
An XdmValue is immutable.
A sequence consisting of a single item may be represented as an instance of
XdmItem,
which is a subtype of XdmValue. However, there is no guarantee that a sequence of length one
will always be an instance of XdmItem.
Similarly, a zero-length sequence may be represented as an instance of
XdmEmptySequence,
but there is no guarantee that every sequence of length zero will always be an instance of
XdmEmptySequence.
XdmValue
protected XdmValue()
XdmValue
public XdmValue(Iterable items)
Create an XdmValue as a sequence of XdmItem objects
items - a sequence of XdmItem objects. Note that if this is supplied as a list or similar
collection, subsequent changes to the list/collection will have no effect on the XdmValue.
getUnderlyingValue
public ValueRepresentation getUnderlyingValue()
Get the underlying implementation object representing the value. This method allows
access to lower-level Saxon functionality, including classes and methods that offer
no guarantee of stability across releases.
- the underlying implementation object representing the value
itemAt
public XdmItem itemAt(int n)
throws IndexOutOfBoundsException,
SaxonApiUncheckedException Get the n'th item in the value, counting from zero.
n - the item that is required, counting the first item in the sequence as item zero
- the n'th item in the sequence making up the value, counting from zero
size
public int size()
Get the number of items in the sequence
- the number of items in the value