Package javax.xml.transform

Examples of javax.xml.transform.TransformerFactory.newTemplates()


        }

        // Check that the call to newTemplates() returns a valid template instance.
        // In case of an xslt parse error, it will return null and we should stop the
        // deployment and raise an exception as the route will not be setup properly.
        Templates templates = factory.newTemplates(source);
        if (templates != null) {
            setTemplate(templates);
        } else {
            throw new TransformerConfigurationException("Error creating XSLT template. "
                    + "This is most likely be caused by a XML parse error. "
View Full Code Here


      builder.setEntityResolver(new DexterEntityResolver(encoding));


      if (inputXSL != null) {
        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]));
View Full Code Here

                //if (q==9) continue;
                File sheet = new File(dir + 'q' + q + ".xsl");
                if (!sheet.exists()) {
                    continue;
                }
                Templates templates = factory.newTemplates(new StreamSource(sheet));

                int runs = 0;
                long totalTime = 0;
                long min = Integer.MAX_VALUE;
                long max = 0;
View Full Code Here

        // tfactory.setAttribute(net.sf.saxon.FeatureKeys.TRACE_LISTENER,
        //                       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

      builder.setEntityResolver(new DexterEntityResolver(encoding));


      if (inputXSL != null) {
        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]));
View Full Code Here

        }

        // Check that the call to newTemplates() returns a valid template instance.
        // In case of an xslt parse error, it will return null and we should stop the
        // deployment and raise an exception as the route will not be setup properly.
        Templates templates = factory.newTemplates(source);
        if (templates != null) {
            setTemplate(templates);
        } else {
            throw new TransformerConfigurationException("Error creating XSLT template. "
                    + "This is most likely be caused by a XML parse error. "
View Full Code Here

private String outTransform(org.jdom.Document doc, String xslName) throws Exception {

   try {
   TransformerFactory tFactory = TransformerFactory.newInstance();
   logger.debug("[outTransform] xslName="+xslName);
   Templates templates = tFactory.newTemplates(new StreamSource(xslName));
   Transformer transformer = templates.newTransformer();
   String contentType = null;

   String docstring = outXML(doc);
   StringWriter out = new StringWriter();
View Full Code Here

private String outTransform(org.jdom.Document doc, String xslName) throws Exception {

   try {
   TransformerFactory tFactory = TransformerFactory.newInstance();
   logger.debug("[outTransform] xslName="+xslName);
   Templates templates = tFactory.newTemplates(new StreamSource(xslName));
   Transformer transformer = templates.newTransformer();
   String contentType = null;

   String docstring = outXML(doc);
   StringWriter out = new StringWriter();
View Full Code Here

                throw new ResourceMissingException(stylesheetURI, "Stylesheet", "Unable to read stylesheet from the specified location. Please check the stylesheet URL");
            }
            addLocalization(xsl, l18n);
            Source src = new DOMSource(xsl);
            TransformerFactory tFactory = TransformerFactory.newInstance();
            temp = tFactory.newTemplates(src);
            if(stylesheetRootCacheEnabled) {
                stylesheetRootCache.put(lookup, temp);
            }
        }
        return temp;
View Full Code Here

        }

        Source stylesheetSource =
            new StreamSource(new ByteArrayInputStream(stylesheet));
        TransformerFactory transformerFactory= TransformerFactory.newInstance();
        Templates templates = transformerFactory.newTemplates(stylesheetSource);

        return templates;
    }

    /**
 
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.