import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
// FOP
import org.apache.fop.fo.Constants;
* ContentHandler that directly place data into the output stream. Layout
* renderers (e.g. PDF & PostScript) use a ContentHandler that builds an FO
* Tree.
- * @return a SAX ContentHandler for handling the SAX events.
- * @throws FOPException if setting up the ContentHandler fails
+ * @return a SAX DefaultHandler for handling the SAX events.
+ * @throws FOPException if setting up the DefaultHandler fails
*/
- public ContentHandler getContentHandler() throws FOPException {
+ public DefaultHandler getDefaultHandler() throws FOPException {
return new FOTreeBuilder(renderType, foUserAgent, stream);
}
+ public ContentHandler getContentHandler() throws FOPException {
+ return getDefaultHandler();
+ }
+
/**
* Render the FO document read by a SAX Parser from an InputHandler
* @param inputHandler the input handler containing the source and
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
/**
return fobjMaker;
}
+ /**
+ * org.xml.sax.ErrorHandler#warning
+ **/
+ public void warning(SAXParseException e) {
+ log.warn(e.toString());
+ }
+
+ /**
+ * org.xml.sax.ErrorHandler#error
+ **/
+ public void error(SAXParseException e) {
+ log.error(e.toString());
+ }
+
+ /**
+ * org.xml.sax.ErrorHandler#fatalError
+ **/
+ public void fatalError(SAXParseException e) throws SAXException {
+ log.error(e.toString());
+ throw e;
+ }
+
/**
* Resets this object for another run.
*/