public interface TreeInfo
extends javax.xml.transform.Source
Java object identity for TreeInfo objects equates to XPath node identity for the root nodes of the relevant trees: that is, two root nodes are "the same node" if and only if their TreeInfo objects are the same Java object. However, when sorting into document order, the order of trees is based on their "document number", a unique number allocated by the document number allocator for the Configuration.
Modifier and Type | Method and Description |
---|---|
Configuration |
getConfiguration()
Get the Configuration to which the nodes in this tree belong
|
long |
getDocumentNumber()
Get the document number, which identifies this tree uniquely within a Configuration.
|
NodeInfo |
getRootNode()
Get the NodeInfo object representing the node at the root of the tree, which will often
but not invariably be a document node
|
SpaceStrippingRule |
getSpaceStrippingRule()
Get details of space stripping action that was applied to this document during
construction.
|
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 that applies to this tree.
|
boolean |
isTyped()
Ask whether the tree contains any nodes whose type annotation is anything other than
UNTYPED or UNTYPED_ATOMIC
|
NodeInfo |
selectID(java.lang.String id,
boolean getParent)
Get the element with a given ID, if any
|
void |
setSpaceStrippingRule(SpaceStrippingRule rule)
Set details of space stripping action that was applied to this document during
construction.
|
void |
setUserData(java.lang.String key,
java.lang.Object value)
Set user data that applies to this tree.
|
NodeInfo getRootNode()
Configuration getConfiguration()
long getDocumentNumber()
boolean isTyped()
NodeInfo selectID(java.lang.String id, boolean getParent)
id
- the required ID valuegetParent
- true if running the element-with-id() function rather than the id()
function; the difference is that in the case of an element of type xs:ID, the parent of
the element should be returned, not the element itself.java.util.Iterator<java.lang.String> getUnparsedEntityNames()
java.lang.String[] getUnparsedEntity(java.lang.String name)
name
- the name of the entityvoid setSpaceStrippingRule(SpaceStrippingRule rule)
rule
- details of the space stripping rules that have been applied to this
document during its construction.SpaceStrippingRule getSpaceStrippingRule()
NoElementsSpaceStrippingRule
,
indicating that no space stripping has been appliedvoid setUserData(java.lang.String key, java.lang.Object value)
getUserData(java.lang.String)
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:".
The key saxon:document-uri
may be used to set the document-uri
property of the document node. If this is set to a non-empty string, the result
of the document-uri() function on the document node will be that string, as an
instance of xs:anyURI. If it is set to a zero-length string, the result of
document-uri() will be the empty sequence, ().
value
- The value to be set for the property. May be null, which effectively
removes the existing value for the property.java.lang.Object getUserData(java.lang.String key)
setUserData(java.lang.String, java.lang.Object)
key
- A string giving the name of the property to be retrieved.Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.