public class InputHandler extends java.lang.Object implements javax.xml.transform.ErrorListener, Renderable
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log
the logger
|
protected java.io.File |
sourcefile
original source file
|
Constructor and Description |
---|
InputHandler(java.io.File fofile)
Constructor for FO input
|
InputHandler(java.io.File xmlfile,
java.io.File xsltfile,
java.util.Vector params)
Constructor for XML->XSLT->FO input
|
Modifier and Type | Method and Description |
---|---|
void |
createCatalogResolver(FOUserAgent userAgent)
Creates a catalog resolver and uses it for XML parsing and XSLT URI resolution.
|
protected javax.xml.transform.Source |
createMainSource()
Creates a Source for the main input file.
|
protected javax.xml.transform.Source |
createXSLTSource()
Creates a Source for the selected stylesheet.
|
void |
error(javax.xml.transform.TransformerException exc) |
void |
fatalError(javax.xml.transform.TransformerException exc) |
void |
renderTo(FOUserAgent userAgent,
java.lang.String outputFormat)
Renders the pre-setup document.
|
void |
renderTo(FOUserAgent userAgent,
java.lang.String outputFormat,
java.io.OutputStream out)
Generate a document, given an initialized Fop object
|
void |
transformTo(java.io.OutputStream out)
In contrast to render(Fop) this method only performs the XSLT stage and saves the
intermediate XSL-FO file to the output file.
|
protected void |
transformTo(javax.xml.transform.Result result)
Transforms the input document to the input format expected by FOP using XSLT.
|
void |
warning(javax.xml.transform.TransformerException exc) |
protected java.io.File sourcefile
protected org.apache.commons.logging.Log log
public InputHandler(java.io.File xmlfile, java.io.File xsltfile, java.util.Vector params)
xmlfile
- XML filexsltfile
- XSLT fileparams
- Vector of command-line parameters (name, value,
name, value, ...) for XSL stylesheet, null if nonepublic InputHandler(java.io.File fofile)
fofile
- the file to read the FO document.public void renderTo(FOUserAgent userAgent, java.lang.String outputFormat, java.io.OutputStream out) throws FOPException
userAgent
- the user agentoutputFormat
- the output format to generate (MIME type, see MimeConstants)out
- the output stream to write the generated output to (may be null if not applicable)FOPException
- in case of an error during processingpublic void renderTo(FOUserAgent userAgent, java.lang.String outputFormat) throws FOPException
renderTo
in interface Renderable
userAgent
- the user agentoutputFormat
- the output format to generate (MIME type, see MimeConstants)FOPException
- if the FO processing failspublic void transformTo(java.io.OutputStream out) throws FOPException
out
- OutputStream to write the transformation result to.FOPException
- in case of an error during processingprotected javax.xml.transform.Source createMainSource()
public void createCatalogResolver(FOUserAgent userAgent)
userAgent
- the user agent instanceprotected javax.xml.transform.Source createXSLTSource()
protected void transformTo(javax.xml.transform.Result result) throws FOPException
result
- the Result object where the result of the XSL transformation is sent toFOPException
- in case of an error during processingpublic void warning(javax.xml.transform.TransformerException exc)
warning
in interface javax.xml.transform.ErrorListener
public void error(javax.xml.transform.TransformerException exc)
error
in interface javax.xml.transform.ErrorListener
public void fatalError(javax.xml.transform.TransformerException exc) throws javax.xml.transform.TransformerException
fatalError
in interface javax.xml.transform.ErrorListener
javax.xml.transform.TransformerException
Copyright 1999-2017 The Apache Software Foundation. All Rights Reserved.