net.sf.saxon.Query.quit()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中net.sf.saxon.Query.quit方法的一些代码示例,展示了Query.quit的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.quit方法的具体详情如下:
包路径:net.sf.saxon.Query
类名称:Query
方法名:quit

Query.quit介绍

[英]Exit with a message
[中]带着信息离开

代码示例

代码示例来源:origin: org.opengis.cite.saxon/saxon9

protected Source processSourceFile(String sourceFileName, boolean useURLs) throws TransformerException {
  Source sourceInput;
  if (useURLs || sourceFileName.startsWith("http:") || sourceFileName.startsWith("file:")) {
    sourceInput = config.getURIResolver().resolve(sourceFileName, null);
    if (sourceInput == null) {
      sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null);
    }
  } else if (sourceFileName.equals("-")) {
    // take input from stdin
    sourceInput = new StreamSource(System.in);
  } else {
    File sourceFile = new File(sourceFileName);
    if (!sourceFile.exists()) {
      quit("Source file " + sourceFile + " does not exist", 2);
    }
    if (Configuration.getPlatform().isJava()) {
      InputSource eis = new InputSource(sourceFile.toURI().toString());
      sourceInput = new SAXSource(eis);
    } else {
      sourceInput = new StreamSource(sourceFile.toURI().toString());
    }
  }
  return sourceInput;
}

代码示例来源:origin: net.sourceforge.saxon/saxon

protected Source processSourceFile(String sourceFileName, boolean useURLs) throws TransformerException {
  Source sourceInput;
  if (useURLs || sourceFileName.startsWith("http:") || sourceFileName.startsWith("file:")) {
    sourceInput = config.getURIResolver().resolve(sourceFileName, null);
    if (sourceInput == null) {
      sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null);
    }
  } else if (sourceFileName.equals("-")) {
    // take input from stdin
    sourceInput = new StreamSource(System.in);
  } else {
    File sourceFile = new File(sourceFileName);
    if (!sourceFile.exists()) {
      quit("Source file " + sourceFile + " does not exist", 2);
    }
    if (Configuration.getPlatform().isJava()) {
      InputSource eis = new InputSource(sourceFile.toURI().toString());
      sourceInput = new SAXSource(eis);
    } else {
      sourceInput = new StreamSource(sourceFile.toURI().toString());
    }
  }
  return sourceInput;
}

代码示例来源:origin: net.sf.saxon/Saxon-HE

protected Source processSourceFile(String sourceFileName, boolean useURLs) throws TransformerException {
  Source sourceInput;
  if (useURLs || CommandLineOptions.isImplicitURI(sourceFileName)) {
    sourceInput = config.getURIResolver().resolve(sourceFileName, null);
    if (sourceInput == null) {
      sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null);
    }
  } else if (sourceFileName.equals("-")) {
    // take input from stdin
    sourceInput = new StreamSource(System.in);
  } else {
    File sourceFile = new File(sourceFileName);
    if (!sourceFile.exists()) {
      quit("Source file " + sourceFile + " does not exist", 2);
    }
    if (Version.platform.isJava()) {
      InputSource eis = new InputSource(sourceFile.toURI().toString());
      sourceInput = new SAXSource(eis);
    } else {
      sourceInput = new StreamSource(sourceFile.toURI().toString());
    }
  }
  return sourceInput;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

protected Source processSourceFile(String sourceFileName, boolean useURLs) throws TransformerException {
  Source sourceInput;
  if (useURLs || CommandLineOptions.isImplicitURI(sourceFileName)) {
    sourceInput = config.getURIResolver().resolve(sourceFileName, null);
    if (sourceInput == null) {
      sourceInput = config.getSystemURIResolver().resolve(sourceFileName, null);
    }
  } else if (sourceFileName.equals("-")) {
    // take input from stdin
    sourceInput = new StreamSource(System.in);
  } else {
    File sourceFile = new File(sourceFileName);
    if (!sourceFile.exists()) {
      quit("Source file " + sourceFile + " does not exist", 2);
    }
    if (Version.platform.isJava()) {
      InputSource eis = new InputSource(sourceFile.toURI().toString());
      sourceInput = new SAXSource(eis);
    } else {
      sourceInput = new StreamSource(sourceFile.toURI().toString());
    }
  }
  return sourceInput;
}

代码示例来源:origin: org.opengis.cite.saxon/saxon9

Source[] sources = resolver.resolve(null, null, locations);
if (sources.length != 1 || !(sources[0] instanceof StreamSource)) {
  quit("Module URI Resolver must return a single StreamSource", 2);

代码示例来源:origin: net.sourceforge.saxon/saxon

if (isStandardResolver) {
  quit("System problem: standard ModuleURIResolver returned null", 4);
} else {
  resolver = staticEnv.getConfiguration().getStandardModuleURIResolver();
  quit("Module URI Resolver must return a single StreamSource", 2);

代码示例来源:origin: net.sourceforge.saxon/saxon

quit("Static error(s) in query", 2);
    } else {
      if (line == -1) {
        File outputFile = new File(outputFileName);
        if (outputFile.isDirectory()) {
          quit("Output is a directory", 2);
  quit(err.getMessage(), 1);
} catch (XPathException err) {
  quit("Query processing failed: " + err.getMessage(), 2);
} catch (TransformerFactoryConfigurationError err) {
  err.printStackTrace();
  quit("Query processing failed", 2);
} catch (SchemaException err) {
  quit("Schema processing failed: " + err.getMessage(), 2);
} catch (Exception err2) {
  err2.printStackTrace();
  quit("Fatal error during query: " + err2.getClass().getName() + ": " +
      (err2.getMessage() == null ? " (no message)" : err2.getMessage()), 2);

代码示例来源:origin: net.sf.saxon/Saxon-HE

if (isStandardResolver) {
  quit("System problem: standard ModuleURIResolver returned null", 4);
} else {
  resolver = getConfiguration().getStandardModuleURIResolver();
  quit("Module URI Resolver must return a single StreamSource", 2);

代码示例来源:origin: org.opengis.cite.saxon/saxon9

quit("Static error(s) in query", 2);
    } else {
      if (line == -1) {
        File outputFile = new File(outputFileName);
        if (outputFile.isDirectory()) {
          quit("Output is a directory", 2);
  quit(err.getMessage(), 1);
} catch (XPathException err) {
  quit("Query processing failed: " + err.getMessage(), 2);
} catch (TransformerFactoryConfigurationError err) {
  err.printStackTrace();
  quit("Query processing failed", 2);
} catch (Exception err2) {
  err2.printStackTrace();
  quit("Fatal error during query: " + err2.getClass().getName() + ": " +
      (err2.getMessage() == null ? " (no message)" : err2.getMessage()), 2);

代码示例来源:origin: net.sourceforge.saxon/saxon

quit(value + " is not a CollectionURIResolver", 2);
    quit("The -outval option requires a schema-aware processor", 2);
} else if (option.equals("val")) {
  if (!schemaAware) {
    quit("The -val option requires a schema-aware processor", 2);
  } else if (value == null || "strict".equals(value)) {
    config.setSchemaValidationMode(Validation.STRICT);
    config.setSchemaValidationMode(Validation.LAX);
  } else {
    quit("The -vlax option requires a schema-aware processor", 2);
    config.setValidationWarnings(true);
  } else {
    quit("The -vw option requires a schema-aware processor", 2);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

if (isStandardResolver) {
  quit("System problem: standard ModuleURIResolver returned null", 4);
} else {
  resolver = getConfiguration().getStandardModuleURIResolver();
  quit("Module URI Resolver must return a single StreamSource", 2);

代码示例来源:origin: org.opengis.cite.saxon/saxon9

quit(value + " is not a CollectionURIResolver", 2);
    quit("The -outval option requires a schema-aware processor", 2);
} else if (option.equals("val")) {
  if (!schemaAware) {
    quit("The -val option requires a schema-aware processor", 2);
  } else if (value == null || "strict".equals(value)) {
    config.setSchemaValidationMode(Validation.STRICT);
    config.setSchemaValidationMode(Validation.LAX);
  } else {
    quit("The -vlax option requires a schema-aware processor", 2);
    config.setValidationWarnings(true);
  } else {
    quit("The -vw option requires a schema-aware processor", 2);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

options.setActualOptions(args);
} catch (XPathException err) {
  quit(err.getMessage(), 2);
    schemaAware = config.isLicensedFeature(Configuration.LicenseFeature.ENTERPRISE_XQUERY);
  } catch (XPathException e) {
    quit(e.getMessage(), 2);
  if (schemaAware && !config.isLicensedFeature(Configuration.LicenseFeature.ENTERPRISE_XQUERY)) {
    if ("EE".equals(config.getEditionCode())) {
      quit("Installed license does not allow schema-aware query", 2);
    } else {
      quit("Schema-aware query requires Saxon Enterprise Edition", 2);
        quit("Static error(s) in query", 2);
      } else {
        if (line == -1) {
      quit(e.getMessage(), 2);
        File outputFile = new File(outputFileName);
        if (outputFile.isDirectory()) {
          quit("Output is a directory", 2);
        options.setSerializationProperties(serializer);
      } catch (IllegalArgumentException e) {
        quit(e.getMessage(), 2);
      if (err.getCause() instanceof XPathException && ((XPathException) err.getCause()).hasBeenReported()) {

代码示例来源:origin: net.sf.saxon/Saxon-HE

options.setActualOptions(args);
} catch (XPathException err) {
  quit(err.getMessage(), 2);
    schemaAware = config.isLicensedFeature(Configuration.LicenseFeature.ENTERPRISE_XQUERY);
  } catch (XPathException e) {
    quit(e.getMessage(), 2);
  if (schemaAware && !config.isLicensedFeature(Configuration.LicenseFeature.ENTERPRISE_XQUERY)) {
    if ("EE".equals(config.getEditionCode())) {
      quit("Installed license does not allow schema-aware query", 2);
    } else {
      quit("Schema-aware query requires Saxon Enterprise Edition", 2);
        quit("Static error(s) in query", 2);
      } else {
        if (line == -1) {
      quit(e.getMessage(), 2);
        File outputFile = new File(outputFileName);
        if (outputFile.isDirectory()) {
          quit("Output is a directory", 2);
        options.setSerializationProperties(serializer);
      } catch (IllegalArgumentException e) {
        quit(e.getMessage(), 2);
      if (err.getCause() instanceof XPathException && ((XPathException) err.getCause()).hasBeenReported()) {

相关文章