import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParserFactory;
// Java
import java.io.IOException;
private Logger log = null;
private FOUserAgent userAgent = null;
- /**
- * Returns the fully qualified classname of the standard XML parser for FOP
- * to use.
- * @return the XML parser classname
- */
- public static final String getParserClassName() {
- try {
- return javax.xml.parsers.SAXParserFactory.newInstance()
- .newSAXParser().getXMLReader().getClass().getName();
- } catch (javax.xml.parsers.ParserConfigurationException e) {
- return null;
- } catch (org.xml.sax.SAXException e) {
- return null;
- }
- }
-
/**
* Main constructor for the Driver class.
*/
return createParser();
}
- /**
- * @see org.apache.fop.apps.InputHandler#run(Driver)
- */
- public void run(Driver driver) throws FOPException {
- throw new FOPException("not implemented: FOInputHandler.run(Driver)");
- }
-
/**
* Creates <code>XMLReader</code> object using default
* <code>SAXParserFactory</code>
}
}
+ /**
+ * Returns the fully qualified classname of the standard XML parser for FOP
+ * to use.
+ * @return the XML parser classname
+ */
+ public static final String getParserClassName() {
+ try {
+ return createParser().getClass().getName();
+ } catch (FOPException e) {
+ return null;
+ }
+ }
}
}
}
- /**
- * Runs this InputHandler through the Driver.
- * @param driver Driver instance to use
- * @throws FOPException if processing this InputHandler fails
- */
- public abstract void run(Driver driver) throws FOPException;
}
}
}
- /**
- * @see org.apache.fop.apps.InputHandler#run(Driver)
- */
- public void run(Driver driver) throws FOPException {
- try {
- transformer.transform(xmlSource,
- new SAXResult(driver.getContentHandler()));
- } catch (Exception ex) {
- throw new FOPException(ex);
- }
- }
-
/**
* Sets an XSLT parameter.
* @param name the name of the parameter
import org.w3c.dom.Document;
// FOP
-import org.apache.fop.apps.Driver;
+import org.apache.fop.apps.FOInputHandler;
/**
* This is an implementation for XML-based images such as SVG.
* @return the created SAX parser
*/
public static String getParserName() {
- String parserClassName = Driver.getParserClassName();
+ String parserClassName = FOInputHandler.getParserClassName();
return parserClassName;
}
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ElementMapping;
-import org.apache.fop.apps.Driver;
+import org.apache.fop.apps.FOInputHandler;
import org.apache.batik.util.XMLResourceDescriptor;
import org.apache.batik.dom.svg.SVGDOMImplementation;
// normally the user agent value is used
try {
XMLResourceDescriptor.setXMLParserClassName(
- Driver.getParserClassName());
+ FOInputHandler.getParserClassName());
foObjs = new HashMap();
foObjs.put("svg", new SE());
* @return the XML parser class name
*/
public String getXMLParserClassName() {
- return org.apache.fop.apps.Driver.getParserClassName();
+ return org.apache.fop.apps.FOInputHandler.getParserClassName();
}
/**