net.sf.saxon.om

Interface Item

All Superinterfaces:
PullEvent, ValueRepresentation
Known Subinterfaces:
DocumentInfo, ExtendedNodeInfo, NodeInfo, SiblingCountingNode, VirtualNode
Known Implementing Classes:
AbsentExtensionElement, AnyURIValue, AtomicValue, Base64BinaryValue, BigIntegerValue, BooleanValue, CalendarValue, DataElement, DateTimeValue, DateValue, DayTimeDurationValue, DecimalValue, DocumentImpl, DocumentWrapper, DocumentWrapper, DocumentWrapper, DocumentWrapper, DocumentWrapper, DotNetObjectValue, DoubleValue, DurationValue, ElementImpl, ElementWithAttributes, ExtensionInstruction, FloatValue, GDateValue, GDayValue, GMonthDayValue, GMonthValue, GYearMonthValue, GYearValue, HexBinaryValue, Int64Value, IntegerValue, LiteralResultElement, NamespaceIterator.NamespaceNodeImpl, NodeImpl, NodeWrapper, NodeWrapper, NodeWrapper, NodeWrapper, NodeWrapper, NotationValue, NumericValue, ObjectValue, Orphan, QNameValue, QualifiedNameValue, SaxonAssign, SaxonCallTemplate, SaxonCollation, SaxonDoctype, SaxonEntityRef, SaxonImportQuery, SaxonScript, SaxonWhile, SQLClose, SQLColumn, SQLConnect, SQLDelete, SQLInsert, SQLQuery, SQLUpdate, StringValue, StrippedDocument, StrippedNode, StyleElement, TextFragmentValue, TimeValue, TinyDocumentImpl, TinyNodeImpl, TinyTextImpl, UnconstructedDocument, UnconstructedElement, UnconstructedParent, UntypedAtomicValue, VirtualCopy, VirtualDocumentCopy, VirtualUntypedCopy, WhitespaceTextImpl, XSLAnalyzeString, XSLApplyImports, XSLApplyTemplates, XSLAttribute, XSLAttributeSet, XSLCallTemplate, XSLCharacterMap, XSLChoose, XSLComment, XSLCopy, XSLCopyOf, XSLDecimalFormat, XSLDocument, XSLElement, XSLFallback, XSLForEach, XSLForEachGroup, XSLFunction, XSLGeneralIncorporate, XSLGeneralVariable, XSLIf, XSLImport, XSLImportSchema, XSLInclude, XSLKey, XSLMatchingSubstring, XSLMessage, XSLNamespace, XSLNamespaceAlias, XSLNextMatch, XSLNumber, XSLOtherwise, XSLOutput, XSLOutputCharacter, XSLParam, XSLPerformSort, XSLPreserveSpace, XSLProcessingInstruction, XSLResultDocument, XSLSequence, XSLSort, XSLStringConstructor, XSLStylesheet, XSLTemplate, XSLText, XSLValueOf, XSLVariable, XSLVariableDeclaration, XSLWhen, XSLWithParam, YearMonthDurationValue

public interface Item
extends ValueRepresentation, PullEvent

An Item is an object that can occur as a member of a sequence. It corresponds directly to the concept of an item in the XPath 2.0 data model. There are two kinds of Item: atomic values, and nodes.

This interface is part of the public Saxon API. As such (starting from Saxon 8.4), methods that form part of the stable API are labelled with a JavaDoc "since" tag to identify the Saxon release at which they were introduced.

Note: there is no method getItemType(). This is to avoid having to implement it on every implementation of NodeInfo. Instead, use the static method Type.getItemType(Item).

Author:
Michael H. Kay
Since:
8.4

Fields inherited from interface net.sf.saxon.om.ValueRepresentation

EMPTY_VALUE_ARRAY

Method Summary

String
getStringValue()
Get the value of the item as a string.
CharSequence
getStringValueCS()
Get the string value of the item as a CharSequence.
SequenceIterator
getTypedValue()
Get the typed value of the item.

Methods inherited from interface net.sf.saxon.om.ValueRepresentation

getStringValue, getStringValueCS

Method Details

getStringValue

public String getStringValue()
Specified by:
getStringValue in interface ValueRepresentation
Returns:
the string value of the item
Since:
8.4

getStringValueCS

public CharSequence getStringValueCS()
Specified by:
getStringValueCS in interface ValueRepresentation
Returns:
the string value of the item
Since:
8.4

getTypedValue

public SequenceIterator getTypedValue()
            throws XPathException
Get the typed value of the item.

For a node, this is the typed value as defined in the XPath 2.0 data model. Since a node may have a list-valued data type, the typed value is in general a sequence, and it is returned in the form of a SequenceIterator.

If the node has not been validated against a schema, the typed value will be the same as the string value, either as an instance of xs:string or as an instance of xs:untypedAtomic, depending on the node kind.

For an atomic value, this method returns an iterator over a singleton sequence containing the atomic value itself.

Returns:
an iterator over the items in the typed value of the node or atomic value. The items returned by this iterator will always be atomic values.
Throws:
XPathException - where no typed value is available, for example in the case of an element with complex content
Since:
8.4