net.sf.saxon
Class TransformerHandlerImpl
public
class
TransformerHandlerImpl
extends ReceivingContentHandler
implements TransformerHandler
TransformerHandlerImpl implements the javax.xml.transform.sax.TransformerHandler
interface. It acts as a ContentHandler and LexicalHandler which receives a stream of
SAX events representing an input document, and performs a transformation treating this
SAX stream as the source document of the transformation.
Author: Michael H. Kay
Method Summary |
void | endDocument()
Override the behaviour of endDocument() in ReceivingContentHandler, so that it fires off
the transformation of the constructed document |
Result | getResult()
Get the output destination of the transformation |
String | getSystemId()
Get the systemId of the document. |
Transformer | getTransformer()
Get the Transformer used for this transformation |
void | setResult(Result result)
Set the output destination of the transformation |
void | setSystemId(String url)
Set the SystemId of the document. |
void | startDocument()
Start of a new document. |
Result result
boolean started
String systemId
protected TransformerHandlerImpl(
Controller controller)
Create a TransformerHandlerImpl and initialise variables. The constructor is protected, because
the Filter should be created using newTransformerHandler() in the SAXTransformerFactory
class
Parameters: controller the Controller to be used
public void endDocument()
Override the behaviour of endDocument() in ReceivingContentHandler, so that it fires off
the transformation of the constructed document
public Result getResult()
Get the output destination of the transformation
Returns: the output destination
public String getSystemId()
Get the systemId of the document. This will be the systemId obtained from the Locator passed to the
TransformerHandlerImpl method if available, otherwise the SystemId passed
to the
setSystemId method.
public Transformer getTransformer()
Get the Transformer used for this transformation
public void setResult(Result result)
Set the output destination of the transformation
public void setSystemId(String url)
Set the SystemId of the document. Note that in reporting location information, Saxon gives
priority to the system Id reported by the SAX Parser in the Locator passed to the
TransformerHandlerImpl method. The SystemId passed to this method
is used as the base URI for resolving relative references.
Parameters: url the systemId of the source document
public void startDocument()
Start of a new document. The TransformerHandler is not serially reusable, so this method
must only be called once.
Throws: SAXException only if an overriding subclass throws this exception UnsupportedOperationException if an attempt is made to reuse the TransformerHandler by calling
startDocument() more than once.