Package net.sf.saxon.s9api

Examples of net.sf.saxon.s9api.XsltExecutable.load()


      //exp = comp.compile(new StreamSource(new File("proc.xsl")));
    } catch (SaxonApiException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    this.trans = exp.load();
  }

  public String run(Reader input, OutputStream output) {
    XdmNode source = null;
                String aftermath = null;
View Full Code Here


      XdmNode source = proc.newDocumentBuilder().build(
          new StreamSource(xmlFile));
      Serializer out = proc.newSerializer(outputStream);
      out.setOutputProperty(Serializer.Property.METHOD, "xml");
      out.setOutputProperty(Serializer.Property.INDENT, "yes");
      XsltTransformer trans = exp.load();
      trans.setInitialContextNode(source);
      trans.setDestination(out);
      trans.transform();
    } catch (SaxonApiException e) {
      LogService.error(e.getMessage(), e);
View Full Code Here

        XdmDestination result = null;
        try {
            XsltCompiler compiler = runtime.getProcessor().newXsltCompiler();
            compiler.setSchemaAware(processor.isSchemaAware());
            XsltExecutable exec = compiler.compile(stylesheet.asSource());
            XsltTransformer transformer = exec.load();

            for (QName name : params.keySet()) {
                RuntimeValue v = params.get(name);
                if (runtime.getAllowGeneralExpressions()) {
                    transformer.setParameter(name, v.getValue());
View Full Code Here

        SAXSource stylesheet = new SAXSource(new InputSource(new StringReader(textStyle)));

        XsltCompiler compiler = processor.newXsltCompiler();
        XsltExecutable exec = compiler.compile(stylesheet);
        XsltTransformer transformer = exec.load();

        //transformer.getUnderlyingController().setBaseOutputURI("http://example.com/");

        // No resolver, there isn't one here.
        DocumentBuilder builder = processor.newDocumentBuilder();
View Full Code Here

    public void run() throws SaxonApiException {
        super.run();

        XsltCompiler compiler = runtime.getProcessor().newXsltCompiler();
        XsltExecutable exec = compiler.compile(prettyPrint.asSource());
        XsltTransformer transformer = exec.load();
        transformer.setInitialContextNode(source.read());

        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        Serializer serializer = new Serializer();
        serializer.setOutputProperty(Serializer.Property.ENCODING, "utf-8");
View Full Code Here

            try {
                XsltCompiler compiler = getProcessor().newXsltCompiler();
                compiler.setSchemaAware(false);
                XsltExecutable exec = compiler.compile(new SAXSource(new InputSource(xsl)));
                XsltTransformer transformer = exec.load();
                transformer.setInitialContextNode(profile);
                XdmDestination result = new XdmDestination();
                transformer.setDestination(result);
                transformer.transform();
View Full Code Here

        if (xsl() != null) {
            XdmDestination result = null;
            try {
                XsltCompiler compiler = runtime.getProcessor().newXsltCompiler();
                XsltExecutable exec = compiler.compile(xsl().asSource());
                XsltTransformer transformer = exec.load();
                transformer.setParameter(_format, new XdmAtomicValue(format));
                transformer.setInitialContextNode(doc);
                result = new XdmDestination();
                transformer.setDestination(result);
                transformer.transform();
View Full Code Here

        }
        if (query != null && queryFile != null) {
          throw new MorphlineCompilationException("Must not define both query and queryFile at the same time", config);
        }
       
        XsltTransformer evaluator = executable.load();
        Config variables = getConfigs().getConfig(fragment, "parameters", ConfigFactory.empty());
        for (Map.Entry<String, Object> entry : new Configs().getEntrySet(variables)) {
          XdmValue xdmValue = XdmNode.wrap(new UntypedAtomicValue(entry.getValue().toString()));
          evaluator.setParameter(new QName(entry.getKey()), xdmValue);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.