Class TransformerReceiver

All Implemented Interfaces:
Result, Receiver

public class TransformerReceiver extends ProxyReceiver
TransformerReceiver is similar in concept to the JAXP TransformerHandler, except that it implements Saxon's Receiver interface rather than the standard SAX2 interface. This means that it allows nodes with type annotations to be passed down a pipeline from one transformation to another.
  • Constructor Details

    • TransformerReceiver

      public TransformerReceiver(XsltController controller)
      Create a TransformerReceiver and initialise variables.
      Parameters:
      controller - the Controller
  • Method Details

    • open

      public void open() throws XPathException
      Start of event stream
      Specified by:
      open in interface Receiver
      Overrides:
      open in class ProxyReceiver
      Throws:
      XPathException - if an error occurs
    • getController

      public Controller getController()
      Get the Controller used for this transformation
      Returns:
      the controller
    • setSystemId

      public void setSystemId(String systemId)
      Set the SystemId of the document
      Specified by:
      setSystemId in interface Result
      Overrides:
      setSystemId in class ProxyReceiver
      Parameters:
      systemId - the URI used to identify the tree being passed across this interface
    • setDestination

      public void setDestination(Receiver destination)
      Set the output destination of the transformation. This method must be called before the transformation can proceed.
      Parameters:
      destination - the destination to which the transformation output will be written
    • getDestination

      public Receiver getDestination()
      Get the output destination of the transformation
      Returns:
      the output destination. May be null if no destination has been set.
    • close

      public void close() throws XPathException
      Override the behaviour of close() in ProxyReceiver, so that it fires off the transformation of the constructed document
      Specified by:
      close in interface Receiver
      Overrides:
      close in class ProxyReceiver
      Throws:
      XPathException - if an error occurs