public class InputHandler extends Object implements ErrorListener, Renderable
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log
the logger
|
protected File |
sourcefile
original source file
|
Constructor and Description |
---|
InputHandler(File fofile)
Constructor for FO input
|
InputHandler(File xmlfile,
File xsltfile,
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 Source |
createMainSource()
Creates a Source for the main input file.
|
protected Source |
createXSLTSource()
Creates a Source for the selected stylesheet.
|
void |
error(TransformerException exc) |
void |
fatalError(TransformerException exc) |
void |
renderTo(FOUserAgent userAgent,
String outputFormat)
Renders the pre-setup document.
|
void |
renderTo(FOUserAgent userAgent,
String outputFormat,
OutputStream out)
Generate a document, given an initialized Fop object
|
void |
transformTo(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(Result result)
Transforms the input document to the input format expected by FOP using XSLT.
|
void |
warning(TransformerException exc) |
protected File sourcefile
protected org.apache.commons.logging.Log log
public InputHandler(File xmlfile, File xsltfile, Vector params)
xmlfile
- XML filexsltfile
- XSLT fileparams
- Vector of command-line parameters (name, value,
name, value, ...) for XSL stylesheet, null if nonepublic InputHandler(File fofile)
fofile
- the file to read the FO document.public void renderTo(FOUserAgent userAgent, String outputFormat, 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, 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(OutputStream out) throws FOPException
out
- OutputStream to write the transformation result to.FOPException
- in case of an error during processingprotected Source createMainSource()
public void createCatalogResolver(FOUserAgent userAgent)
userAgent
- the user agent instanceprotected Source createXSLTSource()
protected void transformTo(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(TransformerException exc)
warning
in interface ErrorListener
public void error(TransformerException exc)
error
in interface ErrorListener
public void fatalError(TransformerException exc) throws TransformerException
fatalError
in interface ErrorListener
TransformerException
Copyright © 2025 Apache Software Foundation. All rights reserved.