org.xml.graphics
Interface XGProcessorHandler
- All Superinterfaces:
- org.xml.sax.ContentHandler
public interface XGProcessorHandler
- extends org.xml.sax.ContentHandler
The XGProcessorHandler is the equivalent of the JAXP TransformerHandler.
For FO processing you will mostly use this interface as it integrates
nicely into the SAX-oriented JAXP pattern.
An example:
//Set up the XGProcessor
XGProcessorFactory factory = new SomeXGProcessorFactory();
XGProcessorHandler xgHandler = factory.newXGProcessorHandler();
//Set up the source, target and XSLT stylesheet
Source src = new StreamSource(new File("C:/temp/data.xml"));
Source xslt = new StreamSource(new File("C:/temp/convert.xsl"));
XGResult pdf = new StreamXGResult("application/pdf",
new File("C:/temp/out.pdf"));
xgHandler.setResult(pdf);
//Setup the JAXP Transformer
TransformerFactory tf = TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer(xslt);
//This links the SAX output from the XSLT stage to the input of the FO stage
Result res = new SAXResult(xgHandler);
//Start the processing run
transformer.transform(src, res);
- Author:
- Jeremias Maerki
Methods inherited from interface org.xml.sax.ContentHandler |
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
setResult
void setResult(XGResult result)
getXGProcessor
XGProcessor getXGProcessor()
Copyright © 2004-2005 Jeremias Märki. All rights reserved.