Package com.saxonica.ee.stream.om

## Class FleetingDocumentNode

- java.lang.Object
- - com.saxonica.ee.stream.om.FleetingNode
  - - com.saxonica.ee.stream.om.FleetingParentNode
    - - com.saxonica.ee.stream.om.FleetingDocumentNode

- All Implemented Interfaces:
    `javax.xml.transform.Source`, `javax.xml.transform.SourceLocator`, `GroundedValue`, `Item`, `NodeInfo`, `Sequence`, `TreeInfo`, `Location`, `org.xml.sax.Locator`

      public class FleetingDocumentNode
      extends FleetingParentNode
      implements TreeInfo

  A Fleeting node (that is a transient node in a streamed document) that represents a document node

- - ### Field Summary

    - ### Fields inherited from class com.saxonica.ee.stream.om.FleetingNode

      `root`

    - ### Fields inherited from interface net.sf.saxon.om.NodeInfo

      `IS_DTD_TYPE, IS_NILLED`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `FleetingDocumentNode​(long docNr)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected int` | `allocateNodeNumber()` |
    `AtomicSequence` | `atomize()` | Get the typed value.
    `void` | `captureInitialCommentOrProcessingInstruction​(NodeInfo node)` | Buffer a comment or processing instruction appearing before the first element start tag
    `void` | `copy​(Receiver out, int copyOptions, Location locationId)` | Copy this node to a given Receiver.
    `void` | `copyInitialCommentsAndProcessingInstructions​(Receiver out)` | Copy any saved initial comments or processing instructions to a specified Receiver; and remove them to release any memory that they occupy
    `java.lang.String` | `getBaseURI()` | Get the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node.
    `Configuration` | `getConfiguration()` | Get the configuration used to build the tree containing this node.
    `long` | `getDocumentNumber()` | Get the document number, which identifies this tree uniquely within a Configuration
    `MultiAccumulatorWatch` | `getMultiAccumulatorWatch()` |
    `NamePool` | `getNamePool()` | Get the NamePool that holds the namecode for this node
    `NodeInfo` | `getRootNode()` | Get the NodeInfo object representing the document node at the root of the tree
    `SpaceStrippingRule` | `getSpaceStrippingRule()` | Get details of space stripping action that was applied to this document during construction.
    `java.lang.String` | `getSystemId()` | Get the System ID for the 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.Object` | `getUserData​(java.lang.String key)` | Get user data held in the document node.
    `void` | `notify​(Receiver out)` | Notify the event to a Receiver
    `NodeInfo` | `selectID​(java.lang.String id, boolean getParent)` | Get the element with a given ID, if any
    `void` | `setConfiguration​(Configuration config)` | Set the configuration
    `void` | `setMultiAccumulatorWatch​(MultiAccumulatorWatch multiWatch)` |
    `void` | `setSpaceStrippingRule​(SpaceStrippingRule rule)` | Set details of space stripping action that was applied to this document during construction.
    `void` | `setSystemId​(java.lang.String systemId)` | Set the system identifier for this Source.
    `void` | `setUnparsedEntity​(java.lang.String name, java.lang.String systemID, java.lang.String publicID)` | Notify an unparsed entity URI.
    `void` | `setUserData​(java.lang.String key, java.lang.Object value)` | Set user data on the document node.

    - ### Methods inherited from class com.saxonica.ee.stream.om.FleetingParentNode

      `hasChildNodes, setHasChildren`

    - ### Methods inherited from class com.saxonica.ee.stream.om.FleetingNode

      `compareOrder, equals, generateId, getAllNamespaces, getAttributeValue, getDeclaredNamespaces, getDepth, getDisplayName, getFingerprint, getInScopeNamespaces, getLocalPart, getNodeKind, getNodeName, getNodeNumber, getParent, getPrefix, getRoot, getSchemaType, getStringValue, getStringValueCS, getURI, hasFingerprint, head, isStreamed, iterateAxis, saveLocation, setNodeKind, setNodeName, setParent, setStringValue, setTypeAnnotation`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface net.sf.saxon.om.GroundedValue

      `asIterable, concatenate, containsNode, effectiveBooleanValue, materialize`

    - ### Methods inherited from interface net.sf.saxon.om.Item

      `getLength, itemAt, iterate, reduce, subsequence`

    - ### Methods inherited from interface net.sf.saxon.om.NodeInfo

      `attributes, children, children, getColumnNumber, getGenre, getLineNumber, getPublicId, hashCode, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, toShortString`

    - ### Methods inherited from interface net.sf.saxon.om.Sequence

      `makeRepeatable`

    - ### Methods inherited from interface javax.xml.transform.Source

      `isEmpty`

    - ### Methods inherited from interface net.sf.saxon.om.TreeInfo

      `isMutable, isTyped`

- - ### Constructor Detail

    - #### FleetingDocumentNode

          public FleetingDocumentNode​(long docNr)

  - ### Method Detail

    - #### getRootNode

          public NodeInfo getRootNode()

      Get the NodeInfo object representing the document node at the root of the tree
      Specified by:
        `getRootNode` in interface `TreeInfo`
      Returns:
        the document node

    - #### getTreeInfo

          public TreeInfo getTreeInfo()

      Description copied from class: `FleetingNode`
      Get information about the tree to which this NodeInfo belongs
      Specified by:
        `getTreeInfo` in interface `NodeInfo`
      Overrides:
        `getTreeInfo` in class `FleetingNode`
      Returns:
        the TreeInfo

    - #### allocateNodeNumber

          protected int allocateNodeNumber()

    - #### getDocumentNumber

          public long getDocumentNumber()

      Get the document number, which identifies this tree uniquely within a Configuration
      Specified by:
        `getDocumentNumber` in interface `TreeInfo`
      Returns:
        the document number

    - #### setConfiguration

          public void setConfiguration​(Configuration config)

      Set the configuration
      Parameters:
        `config` - the configuration to which this document belongs

    - #### setUnparsedEntity

          public void setUnparsedEntity​(java.lang.String name,
                                        java.lang.String systemID,
                                        java.lang.String publicID)
                                 throws XPathException

      Notify an unparsed entity URI.
      Parameters:
        `name` - The name of the unparsed entity
        `systemID` - The system identifier of the unparsed entity
        `publicID` - The public identifier of the unparsed entity
      Throws:
        `XPathException`

    - #### captureInitialCommentOrProcessingInstruction

          public void captureInitialCommentOrProcessingInstruction​(NodeInfo node)

      Buffer a comment or processing instruction appearing before the first element start tag
      Parameters:
        `node` - a comment or processing instruction node

    - #### copyInitialCommentsAndProcessingInstructions

          public void copyInitialCommentsAndProcessingInstructions​(Receiver out)
                                                            throws XPathException

      Copy any saved initial comments or processing instructions to a specified Receiver; and remove them to release any memory that they occupy
      Throws:
        `XPathException`

    - #### selectID

          public NodeInfo selectID​(java.lang.String id,
                                   boolean getParent)

      Get the element with a given ID, if any
      Specified by:
        `selectID` in interface `TreeInfo`
      Parameters:
        `id` - the required ID value
        `getParent` - true if the element required is the parent of the element whose type is xs:ID
      Returns:
        the element with the given ID, or null if there is no such ID present (or if the parser has not notified attributes as being of type ID)

    - #### atomize

          public AtomicSequence atomize()
                                 throws XPathException

      Get the typed value.
      Specified by:
        `atomize` in interface `Item`
      Specified by:
        `atomize` in interface `NodeInfo`
      Overrides:
        `atomize` in class `FleetingNode`
      Returns:
        the typed value. This will either be a single AtomicValue or a Value whose items are atomic values.
      Throws:
        `XPathException` - if the node has no typed value, for example if it is an element node with element-only content

    - #### getUnparsedEntityNames

          public java.util.Iterator<java.lang.String> getUnparsedEntityNames()

      Get the list of unparsed entities defined in this document
      Specified by:
        `getUnparsedEntityNames` in interface `TreeInfo`
      Returns:
        an Iterator, whose items are of type String, containing the names of all unparsed entities defined in this document. If there are no unparsed entities or if the information is not available then an empty iterator is returned

    - #### getUnparsedEntity

          public java.lang.String[] getUnparsedEntity​(java.lang.String name)

      Get the unparsed entity with a given name
      Specified by:
        `getUnparsedEntity` in interface `TreeInfo`
      Parameters:
        `name` - the name of the entity
      Returns:
        if the entity exists, return an array of two Strings, the first holding the system ID of the entity (as an absolute URI if possible), the second holding the public ID if there is one, or null if not. If the entity does not exist, the method returns null. Applications should be written on the assumption that this array may be extended in the future to provide additional information.
      Since:
        8.4

    - #### setSystemId

          public void setSystemId​(java.lang.String systemId)

      Set the system identifier for this Source.

      The system identifier is optional if the source does not get its data from a URL, but it may still be useful to provide one. The application can use a system identifier, for example, to resolve relative URIs and to include in error messages and warnings.

      Specified by:
        `setSystemId` in interface `javax.xml.transform.Source`
      Overrides:
        `setSystemId` in class `FleetingNode`
      Parameters:
        `systemId` - The system identifier as a URL string.

    - #### getConfiguration

          public Configuration getConfiguration()

      Get the configuration used to build the tree containing this node.
      Specified by:
        `getConfiguration` in interface `NodeInfo`
      Specified by:
        `getConfiguration` in interface `TreeInfo`
      Overrides:
        `getConfiguration` in class `FleetingNode`
      Returns:
        the Configuration
      Since:
        8.4

    - #### getNamePool

          public NamePool getNamePool()

      Get the NamePool that holds the namecode for this node
      Overrides:
        `getNamePool` in class `FleetingNode`
      Returns:
        the namepool
      Since:
        8.4

    - #### copy

          public void copy​(Receiver out,
                           int copyOptions,
                           Location locationId)
                    throws XPathException

      Copy this node to a given Receiver.

      This method is primarily for internal use. It should not be considered a stable part of the Saxon API.

      Specified by:
        `copy` in interface `NodeInfo`
      Parameters:
        `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` - Define how namespaces are handled
        `locationId` - If non-zero, identifies the location of the instruction
      Throws:
        `XPathException` - if any downstream error occurs

    - #### getSystemId

          public java.lang.String getSystemId()

      Get the System ID for the node. Note this is not the same as the base URI: the base URI can be modified by xml:base, but the system ID cannot. The base URI is used primarily for resolving relative URIs within the content of the document. The system ID is used primarily in conjunction with a line number, for identifying the location of elements within the source XML, in particular when errors are found. For a document node, the System ID represents the value of the document-uri property as defined in the XDM data model.
      Specified by:
        `getSystemId` in interface `Location`
      Specified by:
        `getSystemId` in interface `org.xml.sax.Locator`
      Specified by:
        `getSystemId` in interface `NodeInfo`
      Specified by:
        `getSystemId` in interface `javax.xml.transform.Source`
      Specified by:
        `getSystemId` in interface `javax.xml.transform.SourceLocator`
      Overrides:
        `getSystemId` in class `FleetingNode`
      Returns:
        the System Identifier of the entity in the source document containing the node, or null if not known or not applicable.
      Since:
        8.4

    - #### getBaseURI

          public java.lang.String getBaseURI()

      Get the Base URI for the node, that is, the URI used for resolving a relative URI contained in the node. This will be the same as the System ID unless xml:base has been used. Where the node does not have a base URI of its own, the base URI of its parent node is returned.
      Specified by:
        `getBaseURI` in interface `NodeInfo`
      Overrides:
        `getBaseURI` in class `FleetingNode`
      Returns:
        the base URI of the node. This may be null if the base URI is unknown.
      Since:
        8.4

    - #### setMultiAccumulatorWatch

          public void setMultiAccumulatorWatch​(MultiAccumulatorWatch multiWatch)

    - #### getMultiAccumulatorWatch

          public MultiAccumulatorWatch getMultiAccumulatorWatch()

    - #### setSpaceStrippingRule

          public void setSpaceStrippingRule​(SpaceStrippingRule rule)

      Set details of space stripping action that was applied to this document during construction. This ensures that space stripping is not applied twice to the same document.
      Specified by:
        `setSpaceStrippingRule` in interface `TreeInfo`
      Parameters:
        `rule` - details of the space stripping rules that have been applied to this document during its construction.
      Since:
        9.9

    - #### getSpaceStrippingRule

          public SpaceStrippingRule getSpaceStrippingRule()

      Get details of space stripping action that was applied to this document during construction. This ensures that space stripping is not applied twice to the same document.
      Specified by:
        `getSpaceStrippingRule` in interface `TreeInfo`
      Returns:
        details of the space stripping rules that have been applied to this document during its construction. By default, returns `NoElementsSpaceStrippingRule`, indicating that no space stripping has been applied
      Since:
        9.9

    - #### setUserData

          public void setUserData​(java.lang.String key,
                                  java.lang.Object value)

      Set user data on the document node. The user data can be retrieved subsequently using `getUserData(java.lang.String)`
      Specified by:
        `setUserData` in interface `TreeInfo`
      Parameters:
        `key` - A string giving the name of the property to be set. Clients are responsible for choosing a key that is likely to be unique. Must not be null. Keys used internally by Saxon are prefixed "saxon:".
        `value` - The value to be set for the property. May be null, which effectively removes the existing value for the property.

    - #### getUserData

          public java.lang.Object getUserData​(java.lang.String key)

      Get user data held in the document node. This retrieves properties previously set using `setUserData(java.lang.String, java.lang.Object)`
      Specified by:
        `getUserData` in interface `TreeInfo`
      Parameters:
        `key` - A string giving the name of the property to be retrieved.
      Returns:
        the value of the property, or null if the property has not been defined.

    - #### notify

          public void notify​(Receiver out)
                      throws XPathException

      Notify the event to a Receiver
      Specified by:
        `notify` in class `FleetingParentNode`
      Parameters:
        `out` - the receiver to be notified
      Throws:
        `XPathException`