public final class TextFragmentValue extends java.lang.Object implements NodeInfo, javax.xml.transform.SourceLocator
IS_DTD_TYPE, IS_NILLED| Constructor and Description |
|---|
TextFragmentValue(Configuration config,
java.lang.CharSequence value,
java.lang.String baseURI)
Constructor: create a result tree fragment containing a single text node
|
| Modifier and Type | Method and Description |
|---|---|
AtomicSequence |
atomize()
Get the typed value.
|
int |
compareOrder(NodeInfo other)
Determine the relative position of this node and another node, in document order.
|
void |
copy(Receiver out,
int copyOptions,
Location locationId)
Copy the result tree fragment value to a given Outputter
|
boolean |
equals(java.lang.Object other)
Determine whether this is the same node as another node
|
void |
generateId(FastStringBuffer buffer)
Get a character string that uniquely identifies this node
|
java.lang.String |
getAttributeValue(java.lang.String uri,
java.lang.String local)
Get the string value of a given attribute of this node
|
java.lang.String |
getBaseURI()
Get the base URI for the document node.
|
NamespaceBinding[] |
getDeclaredNamespaces(NamespaceBinding[] buffer)
Get all namespace undeclarations and undeclarations defined on this element.
|
java.lang.String |
getDisplayName()
Get the display name of this node.
|
int |
getFingerprint()
Get the fingerprint of the node, used for matching names
|
java.lang.String |
getLocalPart()
Get the local name of this node.
|
int |
getNodeKind()
Return the type of node.
|
NodeInfo |
getParent()
Find the parent node of this node.
|
java.lang.String |
getPrefix()
Get the prefix part of the name of this node.
|
NodeInfo |
getRoot()
Get the root node
|
NodeInfo |
getRootNode()
Get the NodeInfo object representing the document node at the root of the tree
|
SchemaType |
getSchemaType()
Get the type annotation of this node, if any.
|
java.lang.String |
getStringValue()
Get the String Value
|
java.lang.CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence.
|
java.lang.String |
getSystemId()
Get the system ID (the document URI) of the document node.
|
TreeInfo |
getTreeInfo()
Get information about the tree to which this NodeInfo belongs
|
java.lang.String[] |
getUnparsedEntity(java.lang.String name)
Get the unparsed entity with a given name
|
java.util.Iterator<java.lang.String> |
getUnparsedEntityNames()
Get the list of unparsed entities defined in this document
|
java.lang.String |
getURI()
Get the URI part of the name of this node.
|
boolean |
hasChildNodes()
Determine whether the node has any children.
|
boolean |
hasFingerprint()
Ask whether this NodeInfo implementation holds a fingerprint identifying the name of the
node in the NamePool.
|
boolean |
isTyped()
Ask whether the document contains any nodes whose type annotation is anything other than
UNTYPED
|
AxisIterator |
iterateAxis(byte axisNumber)
Return an iteration over the nodes reached by the given axis from this node
|
AxisIterator |
iterateAxis(byte axisNumber,
NodeTest nodeTest)
Return an enumeration over the nodes reached by the given axis from this node
|
static NodeInfo |
makeTextFragment(Configuration config,
java.lang.CharSequence value,
java.lang.String baseURI)
Static factory method: create a result tree fragment containing a single text node,
unless the text is zero length, in which case an empty document node is returned
|
Location |
saveLocation()
Get an immutable copy of this Location object.
|
NodeInfo |
selectID(java.lang.String id,
boolean getParent)
Get the element with a given ID.
|
void |
setSystemId(java.lang.String systemId)
Set the system ID (that is, the document URI property) for the document node.
|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetColumnNumber, getConfiguration, getGenre, getLineNumber, getPublicId, hashCode, isId, isIdref, isNilled, isSameNodeInfo, isStreamed, toShortStringgetLength, head, itemAt, iterate, iterator, reduce, subsequence, toGroundedValueasIterable, effectiveBooleanValue, materializemakeRepeatablepublic TextFragmentValue(Configuration config, java.lang.CharSequence value, java.lang.String baseURI)
value - a String containing the valuebaseURI - the base URI of the document nodepublic static NodeInfo makeTextFragment(Configuration config, java.lang.CharSequence value, java.lang.String baseURI)
config - the Saxon Configurationvalue - a String containing the valuebaseURI - the base URI of the document nodepublic TreeInfo getTreeInfo()
getTreeInfo in interface NodeInfopublic NodeInfo getRootNode()
public boolean isTyped()
public final int getNodeKind()
getNodeKind in interface NodeInfoTypepublic java.lang.String getStringValue()
getStringValue in interface GroundedValue<NodeInfo>getStringValue in interface Item<NodeInfo>getStringValue in interface NodeInfoItem.getStringValueCS()public java.lang.CharSequence getStringValueCS()
getStringValueCS in interface GroundedValue<NodeInfo>getStringValueCS in interface Item<NodeInfo>Item.getStringValue()public boolean equals(java.lang.Object other)
public boolean hasFingerprint()
getFingerprint() method must
return the fingerprint of the node. If the answer is false, then the getFingerprint()
method should throw an UnsupportedOperationException. In the case of unnamed nodes
such as text nodes, the result can be either true (in which case getFingerprint() should
return -1) or false (in which case getFingerprint may throw an exception).hasFingerprint in interface NodeInfoFingerprintedNode as a marker interface.public void generateId(FastStringBuffer buffer)
generateId in interface NodeInfobuffer - the buffer to contain the generated IDpublic void setSystemId(java.lang.String systemId)
setSystemId in interface javax.xml.transform.Sourcejava.lang.UnsupportedOperationException - (always). This kind of tree does not have a document URI.public java.lang.String getSystemId()
getSystemId in interface javax.xml.transform.SourcegetSystemId in interface javax.xml.transform.SourceLocatorgetSystemId in interface LocationgetSystemId in interface NodeInfogetSystemId in interface org.xml.sax.Locatorpublic java.lang.String getBaseURI()
getBaseURI in interface NodeInfopublic int compareOrder(NodeInfo other)
compareOrder in interface NodeInfoother - The other node, whose position is to be compared with this nodepublic int getFingerprint()
getFingerprint in interface NodeInfopublic java.lang.String getPrefix()
public java.lang.String getURI()
public java.lang.String getDisplayName()
getDisplayName in interface NodeInfopublic java.lang.String getLocalPart()
getLocalPart in interface NodeInfopublic boolean hasChildNodes()
hasChildNodes in interface NodeInfotrue if this node has any attributes,
false otherwise.public Location saveLocation()
saveLocation in interface Locationpublic SchemaType getSchemaType()
Types derived from a DTD are not reflected in the result of this method.
getSchemaType in interface NodeInfopublic NamespaceBinding[] getDeclaredNamespaces(NamespaceBinding[] buffer)
getDeclaredNamespaces in interface NodeInfobuffer - If this is non-null, and the result array fits in this buffer, then the result
may overwrite the contents of this array, to avoid the cost of allocating a new array on the heap.For a node other than an element, the method returns null.
public AtomicSequence atomize()
public java.lang.String getAttributeValue(java.lang.String uri,
java.lang.String local)
getAttributeValue in interface NodeInfouri - the namespace URI of the attribute name. Supply the empty string for an attribute
that is in no namespacelocal - the local part of the attribute name.public AxisIterator iterateAxis(byte axisNumber)
iterateAxis in interface NodeInfoaxisNumber - The axis to be iterated overAxisInfopublic AxisIterator iterateAxis(byte axisNumber, NodeTest nodeTest)
iterateAxis in interface NodeInfoaxisNumber - The axis to be iterated overnodeTest - A pattern to be matched by the returned nodesAxisInfopublic NodeInfo getParent()
public NodeInfo getRoot()
public void copy(Receiver out, int copyOptions, Location locationId) throws XPathException
copy in interface NodeInfoout - the Receiver to which the node should be copied. It is the caller's
responsibility to ensure that this Receiver is open before the method is called
(or that it is self-opening), and that it is closed after use.copyOptions - a selection of the options defined in CopyOptionslocationId - If non-null, identifies the location of the instruction
that requested this copy. If zero, indicates that the location information
is not availableXPathException - if any downstream error occurspublic NodeInfo selectID(java.lang.String id, boolean getParent)
id - The unique ID of the required elementgetParent - True if, in the case of an element of type xs:ID, we want its parentpublic java.util.Iterator<java.lang.String> getUnparsedEntityNames()
public java.lang.String[] getUnparsedEntity(java.lang.String name)
name - the name of the entityCopyright (c) 2004-2020 Saxonica Limited. All rights reserved.