Package net.sf.saxon

Examples of net.sf.saxon.PreparedStylesheet.newTransformer()


                CompilerInfo info = new CompilerInfo();
                info.setURIResolver(config.getURIResolver());
                info.setErrorListener(config.getErrorListener());
                info.setCompileWithTracing(config.isCompileWithTracing());
                PreparedStylesheet pss = PreparedStylesheet.compile(new StreamSource(styleFile), config, info);
                transformer = (Controller)pss.newTransformer();
                transformer.setInitialMode(initialMode);
                transformer.setInitialTemplate(initialTemplate);
                if (tracing) {
                    transformer.addTraceListener(new XSLTTraceListener());
                }
View Full Code Here


    try {
      Source sourceInput = new StreamSource(new StringReader(xmlInput));
      Source styleSource = new StreamSource(xsltTrasform);
      CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
      PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
      Controller controller = (Controller) sheet.newTransformer();
      StringWriter outWriter = new StringWriter();
      javax.xml.transform.Result result = new StreamResult(outWriter);
      try {
        controller.transform(sourceInput, result);
        System.out.println(outWriter.getBuffer().toString());
View Full Code Here

    try {
      Source sourceInput = new StreamSource(xmlInput);
      Source styleSource = new StreamSource(new StringReader(xsltTrasform));
      CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
      PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
      Controller controller = (Controller) sheet.newTransformer();
      StringWriter outWriter = new StringWriter();
      javax.xml.transform.Result result = new StreamResult(outWriter);
      try {
        controller.transform(sourceInput, result);
        System.out.println(outWriter.getBuffer().toString());
View Full Code Here

    try {
      Source sourceInput = new StreamSource(xmlInput);
      Source styleSource = new StreamSource(xsltTrasform);
      CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
      PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
      Controller controller = (Controller) sheet.newTransformer();
      if (mapParams != null) {
        for (Entry<String, String> entry : mapParams.entrySet()) {
          controller.setParameter(entry.getKey(), entry.getValue());
        }
      }
View Full Code Here

    try {
      Source sourceInput = new StreamSource(new StringReader(xmlInput));
      Source styleSource = new StreamSource(new StringReader(xsltTrasform));
      CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
      PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
      Controller controller = (Controller) sheet.newTransformer();
      if (mapParams != null) {
        for (Entry<String, String> entry : mapParams.entrySet()) {
          controller.setParameter(entry.getKey(), entry.getValue());
        }
      }
View Full Code Here

    try {
      Source sourceInput = new StreamSource(new FileInputStream(inFilename));
      Source styleSource = new StreamSource(new FileInputStream(xslFilename));
      CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
      PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
      Controller controller = (Controller) sheet.newTransformer();
      StringWriter outWriter = new StringWriter();
      javax.xml.transform.Result result = new StreamResult(outWriter);
      try {
        controller.transform(sourceInput, result);
        System.out.println(outWriter.getBuffer().toString());
View Full Code Here

    try {
      Source sourceInput = new StreamSource(new FileInputStream(inFilename));
      Source styleSource = new StreamSource(new FileInputStream(xslFilename));
      CompilerInfo compilerInfo = getConfiguration().getDefaultXsltCompilerInfo();
      PreparedStylesheet sheet = PreparedStylesheet.compile(styleSource, getConfiguration(), compilerInfo);
      Controller controller = (Controller) sheet.newTransformer();
      javax.xml.transform.Result result = new StreamResult(new File(outFilename));
      try {
        controller.transform(sourceInput, result);
      } catch (XPathException err) {
        if (!err.hasBeenReported()) {
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.