net.sf.saxon.s9api
public class XdmDestination extends Object implements Destination
XdmDestination is a Destination in which an XdmNode
is constructed to hold the output of a query or transformation:
that is, a tree using Saxon's implementation of the XDM data model
No data needs to be supplied to the XdmDestination object. The query or transformation
populates an XdmNode, which may then be retrieved using the getXdmNode
method.
An XdmDestination is designed to hold a single document.
It should therefore not be used as the destination of a query that produces multiple
documents. If multiple documents are sent to an XdmDestination,
the getXdmNode method will return the last one.
An XdmDestination can be reused to hold the results of a second query or transformation only if the XdmDestination method is first called to reset its state.
| Field Summary | |
|---|---|
| URI | baseURI |
| Builder | builder |
| TreeModel | treeModel |
| Constructor Summary | |
|---|---|
| XdmDestination() | |
| Method Summary | |
|---|---|
| URI | getBaseURI()
Get the base URI that will be used for the document node when the XdmDestination is written to. |
| Receiver | getReceiver(Configuration config)
Return a Receiver. |
| TreeModel | getTreeModel()
Get the tree model to be used for documents constructed using this XdmDestination.
|
| XdmNode | getXdmNode()
Return the node at the root of the tree, after it has been constructed.
|
| void | reset()
Allow the XdmDestination to be reused, without resetting other properties
of the destination. |
| void | setBaseURI(URI baseURI)
Set the base URI for the document node that will be created when the XdmDestination is written to.
|
| void | setTreeModel(TreeModel model)
Set the tree model to be used for documents constructed using this XdmDestination.
|
Returns: the base URI that will be used for the node that is constructed when the XdmDestination is written to.
Since: 9.1
Parameters: config The Saxon configuration. This is supplied so that the destination can use information from the configuration (for example, a reference to the name pool) to construct or configure the returned Receiver.
Returns: the Receiver to which events are to be sent.
Throws: net.sf.saxon.s9api.SaxonApiException if the Receiver cannot be created
Returns: the tree model in use: typically one of the constants TINY_TREE, TINY_TREE_CONDENSED, or LINKED_TREE. However, in principle a user-defined tree model can be used.
Since: 9.2
This method should not be called while the tree is under construction.
Returns: the root node of the tree (normally a document node). Returns null if the construction of the tree has not yet started.
Throws: IllegalStateException not yet started, or if tree construction has started but is not complete.
XdmDestination to be reused, without resetting other properties
of the destination.Parameters: baseURI the base URI for the node that will be constructed when the XdmDestination is written to. This must be an absolute URI
Throws: IllegalArgumentException if the baseURI supplied is not an absolute URI
Since: 9.1
Parameters: model typically one of the constants TINY_TREE, TINY_TREE_CONDENSED, or LINKED_TREE. However, in principle a user-defined tree model can be used.
Since: 9.2