diff options
author | Keiron Liddle <keiron@apache.org> | 2001-08-14 08:50:47 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2001-08-14 08:50:47 +0000 |
commit | ef851620d13c461d82ba1655cdc68b98879b6ac2 (patch) | |
tree | a35b86d1d32f69f805e27f1a11df44cb5838f815 /src/org/apache/fop/apps | |
parent | 1c4e6b6fb9c9020424dcdeb667db03db1321c555 (diff) | |
download | xmlgraphics-fop-ef851620d13c461d82ba1655cdc68b98879b6ac2.tar.gz xmlgraphics-fop-ef851620d13c461d82ba1655cdc68b98879b6ac2.zip |
added option for url in input handler
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194420 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/apps')
-rw-r--r-- | src/org/apache/fop/apps/FOInputHandler.java | 16 | ||||
-rw-r--r-- | src/org/apache/fop/apps/InputHandler.java | 9 |
2 files changed, 17 insertions, 8 deletions
diff --git a/src/org/apache/fop/apps/FOInputHandler.java b/src/org/apache/fop/apps/FOInputHandler.java index f2828dd20..d3a871903 100644 --- a/src/org/apache/fop/apps/FOInputHandler.java +++ b/src/org/apache/fop/apps/FOInputHandler.java @@ -16,19 +16,27 @@ import org.apache.fop.messaging.MessageHandler; // java import java.io.File; +import java.net.URL; /** * Manages input if it is an xsl:fo file */ public class FOInputHandler extends InputHandler { - File fofile; - public FOInputHandler(File fofile) { + File fofile = null; + URL foURL = null; + public FOInputHandler (File fofile) { this.fofile = fofile; } - public InputSource getInputSource() { - return super.fileInputSource(fofile); + public FOInputHandler (URL url) { + this.foURL = url; + } + + public InputSource getInputSource () { + if (fofile != null) + return super.fileInputSource(fofile); + return super.urlInputSource(foURL); } public XMLReader getParser() throws FOPException { diff --git a/src/org/apache/fop/apps/InputHandler.java b/src/org/apache/fop/apps/InputHandler.java index fe2d7cd7a..c2899ddbe 100644 --- a/src/org/apache/fop/apps/InputHandler.java +++ b/src/org/apache/fop/apps/InputHandler.java @@ -27,6 +27,10 @@ abstract public class InputHandler { abstract public XMLReader getParser() throws FOPException; + static public InputSource urlInputSource(URL url) { + return new InputSource(url.toString()); + } + /** * create an InputSource from a File * @@ -55,10 +59,7 @@ abstract public class InputHandler { * @return the created SAX parser */ protected static XMLReader createParser() throws FOPException { - String parserClassName = System.getProperty("org.xml.sax.parser"); - if (parserClassName == null) { - parserClassName = "org.apache.xerces.parsers.SAXParser"; - } + String parserClassName = Driver.getParserClassName(); MessageHandler.logln("using SAX parser " + parserClassName); try { |