You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Robert Laflamme <rl...@logisil.com> on 1999/12/13 23:18:18 UTC

Suggestion: Replacing the parserClassName in class org.apache.fop.apps.CommandLine

Why not use the SAX parser that comes with Xerces (org.apache.xerces.parsers.SAXParser)
as a replacement to 'com.jclark.xml.sax.Driver'  in the createParser() method ? 


static Parser createParser() {

     String parserClassName =  System.getProperty("org.xml.sax.parser");
     if (parserClassName == null) {
         parserClassName = "org.apache.xerces.parsers.SAXParser";
     }
     System.err.println("using SAX parser " + parserClassName);

     try {
         return (Parser)
         Class.forName(parserClassName).newInstance();
     } catch (ClassNotFoundException e) {
         System.err.println("Could not find " + parserClassName);
     } catch (InstantiationException e) {
         System.err.println("Could not instantiate "  + parserClassName);
     } catch (IllegalAccessException e) {
         System.err.println("Could not access " + parserClassName);
     } catch (ClassCastException e) {
         System.err.println(parserClassName + " is not a SAX driver"); 
     }
     return null;
}
  

Re: Suggestion: Replacing the parserClassName in class org.apache.fop.apps.CommandLine

Posted by Fotis Jannidis <Fo...@lrz.uni-muenchen.de>.
> Why not use the SAX parser that comes with Xerces (org.apache.xerces.parsers.SAXParser)
> as a replacement to 'com.jclark.xml.sax.Driver'  in the createParser() method ? 
If I remember correctly this has already been done -  shortly after the release of FOP 
0.12, so the change has only taken place in the developer code.
Fotis 


________________________________________
Forum Computerphilologie
http://computerphilologie.uni-muenchen.de