com.saxonica.stream.om
Class FleetingDocumentNode

java.lang.Object
  extended by com.saxonica.stream.om.FleetingNode
      extended by com.saxonica.stream.om.FleetingDocumentNode
All Implemented Interfaces:
Source, PullEvent, DocumentInfo, FingerprintedNode, Item, NodeInfo, ValueRepresentation

public class FleetingDocumentNode
extends FleetingNode
implements DocumentInfo

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.stream.om.FleetingNode
root
 
Fields inherited from interface net.sf.saxon.om.NodeInfo
ALL_NAMESPACES, EMPTY_NAMESPACE_LIST, IS_DTD_TYPE, IS_NILLED, LOCAL_NAMESPACES, NO_NAMESPACES
 
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
 
Constructor Summary
FleetingDocumentNode()
           
 
Method Summary
 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 of the document containing this node.
 NamePool getNamePool()
          Get the NamePool that holds the namecode for this node
 String getSystemId()
          Get the System ID for the node.
 String[] getUnparsedEntity(String name)
          Get the unparsed entity with a given name
 Iterator<String> getUnparsedEntityNames()
          Get the list of unparsed entities defined in this document
 NodeInfo selectID(String id, boolean getParent)
          Get the element with a given ID, if any
 void setConfiguration(Configuration config)
          Set the configuration
 void setSystemId(String systemId)
          Set the system identifier for this Source.
 
Methods inherited from class com.saxonica.stream.om.FleetingNode
atomize, compareOrder, copy, generateId, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNodeKind, getParent, getPrefix, getRoot, getStringValue, getStringValueCS, getTypeAnnotation, getTypedValue, getURI, hasChildNodes, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis, setNameCode, setNodeKind, setParent, setStringValue, setTypeAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.saxon.om.NodeInfo
atomize, compareOrder, copy, equals, generateId, getAttributeValue, getColumnNumber, getDeclaredNamespaces, getDisplayName, getDocumentRoot, getFingerprint, getLineNumber, getLocalPart, getNameCode, getNodeKind, getParent, getPrefix, getRoot, getStringValue, getTypeAnnotation, getURI, hasChildNodes, hashCode, isId, isIdref, isNilled, isSameNodeInfo, iterateAxis, iterateAxis
 
Methods inherited from interface net.sf.saxon.om.Item
getStringValueCS, getTypedValue
 

Constructor Detail

FleetingDocumentNode

public FleetingDocumentNode()
Method Detail

setConfiguration

public void setConfiguration(Configuration config)
Set the configuration


selectID

public NodeInfo selectID(String id,
                         boolean getParent)
Get the element with a given ID, if any

Specified by:
selectID in interface DocumentInfo
Parameters:
id - the required ID value
getParent -
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)

getUnparsedEntityNames

public Iterator<String> getUnparsedEntityNames()
Get the list of unparsed entities defined in this document

Specified by:
getUnparsedEntityNames in interface DocumentInfo
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 String[] getUnparsedEntity(String name)
Get the unparsed entity with a given name

Specified by:
getUnparsedEntity in interface DocumentInfo
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(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 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
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

Specified by:
getNamePool in interface NodeInfo
Overrides:
getNamePool in class FleetingNode
Returns:
the namepool
Since:
8.4

getDocumentNumber

public long getDocumentNumber()
Get the document number of the document containing this node. For a free-standing orphan node, just return the hashcode.

Specified by:
getDocumentNumber in interface NodeInfo
Overrides:
getDocumentNumber in class FleetingNode
Returns:
the document number of the document containing this node
Since:
8.4

getSystemId

public 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 Source
Specified by:
getSystemId in interface NodeInfo
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 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


Copyright (c) Saxonica Limited. All rights reserved.