Package net.sf.saxon.s9api
Class XdmDestination
- java.lang.Object
-
- net.sf.saxon.s9api.XdmDestination
-
- All Implemented Interfaces:
Destination
public class XdmDestination extends java.lang.Object implements Destination
AnXdmDestination
is aDestination
in which anXdmNode
is constructed to hold the output of a query or transformation: that is, a tree using Saxon's implementation of the XDM data modelNo data needs to be supplied to the
XdmDestination
object. The query or transformation populates anXmlNode
, which may then be retrieved using thegetXdmNode
method.An XdmDestination can be reused to hold the results of a second transformation only if the
reset()
method is first called to reset its state.
-
-
Constructor Summary
Constructors Constructor Description XdmDestination()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.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.XdmNode
getXdmNode()
Return the node at the root of the tree, after it has been constructed.void
reset()
Allow theXdmDestination
to be reusedvoid
setBaseURI(java.net.URI baseURI)
Set the base URI for the document node that will be created when the XdmDestination is written to.
-
-
-
Method Detail
-
setBaseURI
public void setBaseURI(java.net.URI baseURI)
Set the base URI for the document node that will be created when the XdmDestination is written to. This method must be called before writing to the destination; it has no effect on an XdmNode that has already been constructed.- 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:
java.lang.IllegalArgumentException
- if the baseURI supplied is not an absolute URI- Since:
- 9.1
-
getBaseURI
public java.net.URI getBaseURI()
Get the base URI that will be used for the document node when the XdmDestination is written to.- Returns:
- the base URI that will be used for the node that is constructed when the XdmDestination is written to.
- Throws:
java.lang.IllegalStateException
- if the a base URI has been configured using internal interfaces, and is not a valid URI- Since:
- 9.1
-
getReceiver
public Receiver getReceiver(Configuration config) throws SaxonApiException
Return a Receiver. Saxon calls this method to obtain a Receiver, to which it then sends a sequence of events representing the content of an XML document.- Specified by:
getReceiver
in interfaceDestination
- 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:
SaxonApiException
- if the Receiver cannot be created
-
getXdmNode
public XdmNode getXdmNode()
Return the node at the root of the tree, after it has been constructed.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. The result is undefined if tree construction has started but is not complete.
-
reset
public void reset()
Allow theXdmDestination
to be reused
-
-