keiron      01/08/14 01:50:47

  Modified:    src/org/apache/fop/apps InputHandler.java
                        FOInputHandler.java
  Log:
  added option for url in input handler
  
  Revision  Changes    Path
  1.5       +6 -5      xml-fop/src/org/apache/fop/apps/InputHandler.java
  
  Index: InputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/InputHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InputHandler.java 2001/07/30 20:29:18     1.4
  +++ InputHandler.java 2001/08/14 08:50:47     1.5
  @@ -1,5 +1,5 @@
   /*
  - * $Id: InputHandler.java,v 1.4 2001/07/30 20:29:18 tore Exp $
  + * $Id: InputHandler.java,v 1.5 2001/08/14 08:50:47 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -27,6 +27,10 @@
       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 @@
        * @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 {
  
  
  
  1.5       +13 -5     xml-fop/src/org/apache/fop/apps/FOInputHandler.java
  
  Index: FOInputHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/FOInputHandler.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- FOInputHandler.java       2001/07/30 20:29:18     1.4
  +++ FOInputHandler.java       2001/08/14 08:50:47     1.5
  @@ -1,5 +1,5 @@
   /*
  - * $Id: FOInputHandler.java,v 1.4 2001/07/30 20:29:18 tore Exp $
  + * $Id: FOInputHandler.java,v 1.5 2001/08/14 08:50:47 keiron Exp $
    * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
    * For details on use and redistribution please refer to the
    * LICENSE file included with these sources.
  @@ -16,19 +16,27 @@
   
   // 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 {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to