Package com.xmlcalabash.core

Examples of com.xmlcalabash.core.XProcConfiguration


   }

   @Override
   public Pipeline build(String pipelineUri) {
      try {
         XProcConfiguration config = new XProcConfiguration(schemaAware);
         XProcRuntime runtime = new XProcRuntime(config);
         if (messageListener != null) {
             runtime.setMessageListener(messageListener);
         }
View Full Code Here


   }
  
   @Override
   public Pipeline build(String pipelineUri, URIResolver... resolvers) {
      try {
         XProcConfiguration config = new XProcConfiguration(schemaAware);
         XProcRuntime runtime = new XProcRuntime(config);
         InputStreamUriParameterResolver streamResolver = new InputStreamUriParameterResolver(new XProcURIResolver(runtime));
         streamResolver.addResolver(new ClassPathUriResolver());
         for (URIResolver resolver: resolvers) {
            streamResolver.addResolver(resolver);
View Full Code Here

  DocumentBuilder builder = null;
  XsltTransformer trans = null;
  XProcRuntime runtime = null;
 
  public PipelineRunner(InputStream xslSheet) {
    XProcConfiguration config = new XProcConfiguration();
    config.debug = true;
    this.runtime = new XProcRuntime(config);
    //GenericConfig config = new GenericConfig();
    //this.runtime = new XProcRuntime(config);
    Processor proc = runtime.getProcessor();
View Full Code Here

   protected Map<URI,PipelineInfo> instances;
   protected XProcConfiguration config;
   protected XProcRuntime runtime;
  
   public XProcCache() {
      config = new XProcConfiguration();
      runtime = new XProcRuntime(config);
      instances = new TreeMap<URI,PipelineInfo>();
   }
View Full Code Here

            System.err.println(xe.getMessage());
            usage();
        }

        try {
            XProcConfiguration config = userArgs.createConfiguration();

            if (run(userArgs, config)) {
                // It's just sooo much nicer if there's a newline at the end.
                System.out.println();
            }
View Full Code Here

        } catch (XProcException xe) {
            System.err.println(xe.getMessage());
            System.exit(-1);
        }

        XProcConfiguration config = null;
        XProcRuntime runtime = null;

        try {
            config = userArgs.createConfiguration();
            runtime = new XProcRuntime(config);
View Full Code Here

        }
    }

    public XProcConfiguration createConfiguration() throws SaxonApiException {
        checkArgs();
        XProcConfiguration config = null;

        // Blech
        try {
            String proc = saxonProcessor;
            if (schemaAware) {
                proc = "ee";
            }

            if (saxonConfig != null) {
                config = new XProcConfiguration(saxonConfig);
            } else if (proc != null) {
                config = new XProcConfiguration(proc, schemaAware);
            } else {
                config = new XProcConfiguration();
            }
        } catch (Exception e) {
            err.println("FATAL: Failed to parse Saxon configuration file.");
            err.println(e);
            exit(2);
        }

        if (this.config != null) {
            try {
                InputStream instream;
                switch (this.config.getKind()) {
                    case URI:
                        URI furi = URI.create(this.config.getUri());
                        instream = new FileInputStream(new File(furi));
                        break;

                    case INPUT_STREAM:
                        instream = this.config.getInputStream();
                        break;

                    default:
                        throw new UnsupportedOperationException(format("Unsupported config kind '%s'", this.config.getKind()));
                }


                SAXSource source = new SAXSource(new InputSource(instream));
                // No resolver, we don't have one yet
                DocumentBuilder builder = config.getProcessor().newDocumentBuilder();
                XdmNode doc = builder.build(source);
                config.parse(doc);
            } catch (Exception e) {
                err.println("FATAL: Failed to parse configuration file.");
                err.println(e);
                exit(3);
            }
View Full Code Here

            return new EmptyRepresentation();
        }
    }

    protected Representation getOutput(PipelineConfiguration pipeconfig, String port) {
        XProcConfiguration config = getConfiguration();
        XPipeline pipeline = pipeconfig.pipeline;
        XProcRuntime runtime = pipeconfig.runtime;
        Serialization serial = pipeline.getSerialization(port);

        if (serial == null) {
View Full Code Here

        if (tests.size() == 0) {
            System.err.println(usage);
            System.exit(1);
        }

        XProcConfiguration config = new XProcConfiguration("ee", schemaAware);
        XProcRuntime runtime = new XProcRuntime(config);

        RunTestReport test = new RunTestReport(runtime, new DefaultTestReporter(runtime));
        test.runTests(tests);
    }
View Full Code Here

TOP

Related Classes of com.xmlcalabash.core.XProcConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.