public class SpaceStrippedNode extends AbstractVirtualNode implements WrappingFunction
docWrapper, node, parent
ALL_NAMESPACES, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES
Modifier | Constructor and Description |
---|---|
protected |
SpaceStrippedNode() |
protected |
SpaceStrippedNode(NodeInfo node,
SpaceStrippedNode parent)
This constructor is protected: nodes should be created using the makeWrapper
factory method
|
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.
|
int |
comparePosition(NodeInfo other)
Determine the relative position of this node and another node, in document order,
distinguishing whether the first node is a preceding, following, descendant, ancestor,
or the same node as the second.
|
void |
copy(Receiver out,
int copyOptions,
Location locationId)
Copy this node to a given outputter (deep copy)
|
NodeInfo |
getParent()
Get the NodeInfo object representing the parent of this node
|
java.lang.CharSequence |
getStringValueCS()
Get the value of the item as a CharSequence.
|
static boolean |
isPreservedNode(NodeInfo node,
SpaceStrippedDocument docWrapper,
NodeInfo actualParent)
Ask whether a node is preserved after whitespace stripping
|
boolean |
isSameNodeInfo(NodeInfo other)
Determine whether this is the same node as another node.
|
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 iteration over the nodes reached by the given axis from this node
|
protected static SpaceStrippedNode |
makeWrapper(NodeInfo node,
SpaceStrippedDocument docWrapper,
SpaceStrippedNode parent)
Factory method to wrap a node with a wrapper that implements the Saxon
NodeInfo interface.
|
VirtualNode |
makeWrapper(NodeInfo node,
VirtualNode parent)
Factory method to wrap a node within the same document as this node with a VirtualNode
|
equals, generateId, getAttributeValue, getBaseURI, getColumnNumber, getConfiguration, getDeclaredNamespaces, getDisplayName, getFingerprint, getLineNumber, getLocalPart, getNodeKind, getPrefix, getPublicId, getRealNode, getRoot, getSchemaType, getStringValue, getSystemId, getTreeInfo, getUnderlyingNode, getURI, hasChildNodes, hasFingerprint, hashCode, head, isId, isIdref, isNilled, isStreamed, iterate, saveLocation, setSystemId
protected SpaceStrippedNode()
protected SpaceStrippedNode(NodeInfo node, SpaceStrippedNode parent)
node
- The node to be wrappedparent
- The StrippedNode that wraps the parent of this nodeprotected static SpaceStrippedNode makeWrapper(NodeInfo node, SpaceStrippedDocument docWrapper, SpaceStrippedNode parent)
node
- The underlying nodedocWrapper
- The wrapper for the document node (must be supplied)parent
- The wrapper for the parent of the node (null if unknown)public VirtualNode makeWrapper(NodeInfo node, VirtualNode parent)
makeWrapper
in interface WrappingFunction
node
- The underlying nodeparent
- The wrapper for the parent of the node (null if unknown)public static boolean isPreservedNode(NodeInfo node, SpaceStrippedDocument docWrapper, NodeInfo actualParent)
node
- the node in questiondocWrapper
- the root of the space-stripped virtual treeactualParent
- the (real) parent of the node in questionpublic AtomicSequence atomize() throws XPathException
atomize
in interface Item
atomize
in interface NodeInfo
atomize
in class AbstractVirtualNode
XPathException
- if the node has no typed value, for example if
it is an element node with element-only contentpublic boolean isSameNodeInfo(NodeInfo other)
isSameNodeInfo
in interface NodeInfo
isSameNodeInfo
in class AbstractVirtualNode
other
- the node to be compared with this nodepublic int compareOrder(NodeInfo other)
compareOrder
in interface NodeInfo
compareOrder
in class AbstractVirtualNode
other
- The other node, whose position is to be compared with this nodepublic int comparePosition(NodeInfo other)
comparePosition
in interface NodeInfo
comparePosition
in class AbstractVirtualNode
other
- The other node, whose position is to be compared with this
nodeAxisInfo.PRECEDING
if this node is on the preceding axis of the other node;
AxisInfo.FOLLOWING
if it is on the following axis; AxisInfo.ANCESTOR
if the first node is an
ancestor of the second; AxisInfo.DESCENDANT
if the first is a descendant of the second;
AxisInfo.SELF
if they are the same node.java.lang.UnsupportedOperationException
- if either node is an attribute or namespacepublic java.lang.CharSequence getStringValueCS()
getStringValueCS
in interface Item
getStringValueCS
in class AbstractVirtualNode
Item.getStringValue()
public NodeInfo getParent()
public AxisIterator iterateAxis(byte axisNumber, NodeTest nodeTest)
AbstractVirtualNode
iterateAxis
in interface NodeInfo
iterateAxis
in class AbstractVirtualNode
axisNumber
- the axis to be usednodeTest
- A pattern to be matched by the returned nodesAxisInfo
public AxisIterator iterateAxis(byte axisNumber)
iterateAxis
in interface NodeInfo
axisNumber
- the axis to be usedAxisInfo
public void copy(Receiver out, int copyOptions, Location locationId) throws XPathException
copy
in interface NodeInfo
out
- 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 CopyOptions
locationId
- 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 occursCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.