Package net.sf.saxon

Examples of net.sf.saxon.PreparedStylesheet


    String strResult = "";
    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


    String strResult = null;
    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

    String strResult = "";
    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

    String strResult = "";
    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

    String strResult = "";
    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

  public static void xsltFromFile(String inFilename, String xslFilename, String outFilename) {
    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

Related Classes of net.sf.saxon.PreparedStylesheet

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.