Package javax.xml.transform

Examples of javax.xml.transform.Templates.newTransformer()


          }
        }

        if (null != stylesheet)
        {
          Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer();
          transformer.setErrorListener(new DefaultErrorHandler());

          // Override the output format?
          if (null != outputType)
          {
View Full Code Here


     */
    public Transformer newTransformer(Source source) throws
  TransformerConfigurationException
    {
  final Templates templates = newTemplates(source);
  final Transformer transformer = templates.newTransformer();
  if (_uriResolver != null) {
      transformer.setURIResolver(_uriResolver);
  }
  return(transformer);
    }
View Full Code Here

          }
        }

        if (null != stylesheet)
        {
          Transformer transformer = flavor.equals("th") ? null : stylesheet.newTransformer();
          transformer.setErrorListener(new DefaultErrorHandler());

          // Override the output format?
          if (null != outputType)
          {
View Full Code Here

            // Create a transformer for the stylesheet.
            Templates templates = null;
            Transformer transformer;
            if (location != null) {
                templates = getTemplates(location);
                transformer = templates.newTransformer();
            } else
                transformer = TransformerFactory.newInstance().newTransformer();

            transformer.setURIResolver(getURIResolver());
View Full Code Here

      // Perform XSL transform on the xml.
      StringReader reader = new StringReader(xml.toString());
      TransformerFactory tf = TransformerFactory.newInstance();
      // Create the transformer from the xsl
      Templates xsl = tf.newTemplates(new StreamSource(xslContent));
      Transformer t = xsl.newTransformer();
      t.transform(new StreamSource(reader), new StreamResult(html));
     
    } catch (Exception e) {
      throw new EJBException("Error processing query results", e);
    } finally {
View Full Code Here

            // Create transformer factory
            TransformerFactory factory = TransformerFactory.newInstance();
            Templates template = factory.newTemplates(new StreamSource(new FileInputStream(localXslPath)));

            // Use the template to create a transformer
            Transformer xformer = template.newTransformer();

            // Prepare the input and output files
            Source source = new StreamSource(new FileInputStream(libraryXmlPath));
            Result result = new StreamResult(new FileOutputStream(localXmlPath));
View Full Code Here

        TransformerFactory transFact = TransformerFactory.newInstance();
        Templates templates = transFact.newTemplates(new StreamSource(
            new File((inputXSL))));

        while (argp < args.length) {
          Transformer transformer = templates.newTransformer();
          Source source = new StreamSource(new File(args[argp]));
          source.setSystemId(args[argp]);
          transformer.transform(source, new StreamResult(System.out));
          ++argp;
        }
View Full Code Here

                for (int t=0; t<10; t++) {
                    Result result = new Sink();
                    long start, end;

                    start = System.currentTimeMillis();
                    templates.newTransformer().transform(doc, result);
                    end = System.currentTimeMillis();

                    runs++;
                    long time = (end - start);
                    if (time < min) min = time;
View Full Code Here

        //                       new net.sf.saxon.trace.XSLTTraceListener());

        // Compile the stylesheet

        Templates templates = tfactory.newTemplates(new StreamSource(xslID));
        Transformer transformer = templates.newTransformer();

        // Now do a transformation
       
        transformer.transform(docw, new StreamResult(System.out));
View Full Code Here

        TransformerFactory transFact = TransformerFactory.newInstance();
        Templates templates = transFact.newTemplates(new StreamSource(
            new File((inputXSL))));

        while (argp < args.length) {
          Transformer transformer = templates.newTransformer();
          Source source = new StreamSource(new File(args[argp]));
          source.setSystemId(args[argp]);
          transformer.transform(source, new StreamResult(System.out));
          ++argp;
        }
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.