public interface Item extends Sequence, PullEvent
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).
Modifier and Type | Method and Description |
---|---|
String |
getStringValue()
Get the value of the item as a string.
|
CharSequence |
getStringValueCS()
Get the string value of the item as a CharSequence.
|
String getStringValue()
If the calling code can handle any CharSequence, the method 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()
Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.