Class VirtualUntypedCopy

  • All Implemented Interfaces:
    javax.xml.transform.Source, javax.xml.transform.SourceLocator, PullEvent, Item, NodeInfo, ValueRepresentation

    public class VirtualUntypedCopy
    extends VirtualCopy
    This class represents a virtual copy of a node with type annotations stripped
    • Constructor Detail

      • VirtualUntypedCopy

        protected VirtualUntypedCopy​(NodeInfo base)
        Protected constructor: create a virtual copy of a node
        Parameters:
        base - the node to be copied
    • Method Detail

      • makeVirtualUntypedCopy

        public static VirtualCopy makeVirtualUntypedCopy​(NodeInfo original,
                                                         NodeInfo root)
        Public factory method: create an untyped virtual copy of a node
        Parameters:
        original - the node to be copied
        root - the root of the tree
        Returns:
        the virtual copy.
      • atomize

        public Value atomize()
                      throws XPathException
        Get the typed value. The result of this method will always be consistent with the method Item.getTypedValue(). However, this method is often more convenient and may be more efficient, especially in the common case where the value is expected to be a singleton.
        Specified by:
        atomize in interface NodeInfo
        Overrides:
        atomize in class VirtualCopy
        Returns:
        the typed value. If requireSingleton is set to true, the result will always be an AtomicValue. In other cases it may be a Value representing a sequence whose items are atomic values.
        Throws:
        XPathException
        Since:
        8.5
      • copy

        public void copy​(Receiver out,
                         int whichNamespaces,
                         boolean copyAnnotations,
                         int locationId)
                  throws XPathException
        Description copied from class: VirtualCopy
        Copy this node to a given outputter
        Specified by:
        copy in interface NodeInfo
        Overrides:
        copy in class VirtualCopy
        Parameters:
        out - the Receiver to which the node should be copied
        whichNamespaces - in the case of an element, controls which namespace nodes should be copied. Values are NO_NAMESPACES, LOCAL_NAMESPACES, ALL_NAMESPACES
        copyAnnotations - indicates whether the type annotations of element and attribute nodes should be copied
        locationId - Identifies the location of the instruction that requested this copy. Pass zero if no other information is available
        Throws:
        XPathException
      • makeCopier

        protected VirtualCopy.VirtualCopier makeCopier​(AxisIterator axis,
                                                       VirtualCopy newParent,
                                                       NodeInfo root)
        Create an iterator that makes and returns virtual copies of nodes on the original tree
        Overrides:
        makeCopier in class VirtualCopy
        Parameters:
        axis - the axis to be navigated
        newParent - the parent of the nodes in the new virtual tree (may be null)
        root - the root of the virtual tree
        Returns:
        the iterator that does the copying