示例#1
0
 public int runXmlImport() {
   DataImportXmlParser responseHandler = null;
   try {
     XMLReader parser = EfaUtil.getXMLReader();
     responseHandler = new DataImportXmlParser(this, dataAccess);
     parser.setContentHandler(responseHandler);
     parser.parse(new InputSource(new FileInputStream(filename)));
   } catch (Exception e) {
     logInfo(e.toString());
     errorCount++;
     Logger.log(e);
     if (Daten.isGuiAppl()) {
       Dialog.error(e.toString());
     }
   }
   return (responseHandler != null ? responseHandler.getImportedRecordsCount() : 0);
 }
示例#2
0
  // Startmethode
  public static boolean run(String filename, String fileto, Vector allOptions) {
    if (!fileto.toLowerCase().endsWith(".xsl")) fileto += ".xsl";

    XMLReader parser;
    parser = XSLTReader.tryToSetup(null);
    if (parser == null) parser = XSLTReader.tryToSetup("org.apache.xerces.parsers.SAXParser");
    if (parser == null) parser = XSLTReader.tryToSetup("javax.xml.parsers.SAXParser"); // Java 1.5
    if (parser == null) parser = XSLTReader.tryToSetup("org.apache.crimson.parser.XMLReaderImpl");

    try {
      parser.setContentHandler(new XSLTWriter(allOptions, fileto));
      parser.parse(filename);
    } catch (Exception e) {
      Logger.log(Logger.ERROR, Logger.MSG_DEBUG_ELWIZ, "PARSER EXCEPTION: " + e);
    }

    return true;
  }