net.sf.saxon.s9api
Interface Destination
- DOMDestination, SAXDestination, SchemaValidator, Serializer, XdmDestination, XsltTransformer
public interface Destination
A Destination represents a place where XML can be sent. It is used, for example,
to define the output of a transformation or query.
The interface
Destination
has some similarities with the JAXP
javax.xml.transform.Result
class. It differs, however, in that implementations
of this interface can be written by users or third parties to define new kinds of
destination, and any such implementation can be supplied to the Saxon methods that
take a
Destination
as an argument.
Implementing a new
Destination
, however, will generally require access
to implementation-level classes and methods within the Saxon product. The only method that
needs to be supplied is
getReceiver(Configuration)
, which returns an instance of
Receiver
, and unless you use an existing implementation of
Receiver
, you will need to handle internal Saxon concepts such as name codes
and name pools.
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.
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.
- the Receiver to which events are to be sent.