public interface Item extends Sequence, PullEvent
Modifier and Type | Method and Description |
---|---|
AtomicSequence |
atomize()
Atomize the item.
|
String |
getStringValue()
Get the value of the item as a string.
|
CharSequence |
getStringValueCS()
Get the string value of the item as a CharSequence.
|
Item |
head()
Get the first item in the sequence.
|
Item head()
Sequence
in that
no exception is thrown.String getStringValue()
getStringValueCS()
should
be used. If the caller requires a string, this method is preferred.UnsupportedOperationException
- if the item is a function item (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)getStringValueCS()
CharSequence getStringValueCS()
X.getStringValueCS().toString()
returns a string that is equal to
X.getStringValue()
.
Note that two CharSequence values of different types should not be compared using equals(), and
for the same reason they should not be used as a key in a hash table.
If the calling code can handle any CharSequence, this method should
be used. If the caller requires a string, the getStringValue()
method is preferred.UnsupportedOperationException
- if the item is a function item (an unchecked exception
is used here to avoid introducing exception handling to a large number of paths where it is not
needed)getStringValue()
AtomicSequence atomize() throws XPathException
XPathException
- if atomization is not allowed
for this kind of itemCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.