Package javax.xml.transform

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


            dfactory.setNamespaceAware(true);

            DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
            Node xslDOM = docBuilder.parse(new InputSource(xslFileName));

            stylesheet = tfactory.newTemplates(new DOMSource(xslDOM,
                    xslFileName));
          }
          else
          {
            // System.out.println("Calling newTemplates: "+xslFileName);
View Full Code Here


                    xslFileName));
          }
          else
          {
            // System.out.println("Calling newTemplates: "+xslFileName);
            stylesheet = tfactory.newTemplates(new StreamSource(xslFileName));
            // System.out.println("Done calling newTemplates: "+xslFileName);
          }
        }

        PrintWriter resultWriter;
View Full Code Here

          Source source =
            stf.getAssociatedStylesheet(new StreamSource(inFileName), media,
                                        null, null);

          if (null != source)
            stylesheet = tfactory.newTemplates(source);
          else
          {
            if (null != media)
              throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEET_IN_MEDIA, new Object[]{inFileName, media})); //"No stylesheet found in: "
                                            // + inFileName + ", media="
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 an XML parse error. "
View Full Code Here

                    if (getUriResolver() != null) {
                        transformerFactory.setURIResolver(getUriResolver());
                    }

                    // Create a new transformer
                    this.templates = transformerFactory
                            .newTemplates(transformSource);
                } catch (TransformerConfigurationException tce) {
                    throw new IOException(
                            "Transformer configuration exception. "
                                    + tce.getMessage());
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, url.toExternalForm()); // Set SystemId for xsl imports
            TransformerFactory tFactory = TransformerFactory.newInstance();
            temp = tFactory.newTemplates(src);
            if(stylesheetRootCacheEnabled) {
              stylesheetRootCache.put(lookup, temp);
            }
            return temp;
        }
View Full Code Here

    public static void debug(Document doc) {
        try {
            TransformerFactory tf = TransformerFactory.newInstance();
            StringReader input = new StringReader(PRETTY_PRINTER);
            Templates templates = tf.newTemplates(new StreamSource(input));
            OutputStream result = new ByteArrayOutputStream();
            templates.newTransformer().transform(
                new DOMSource(doc),
                new StreamResult(result));
            LOGGER.debug(result.toString());
View Full Code Here

    transformers = new HashMap<String, Transformer>();
    TransformerFactory xformFactory = new org.apache.xalan.processor.TransformerFactoryImpl();

    transformers.put(
        "WADL",
        xformFactory.newTemplates(
            new StreamSource( SoapUI.class
                .getResourceAsStream( "/com/eviware/soapui/resources/doc/wadl_documentation.xsl" ) ) )
            .newTransformer() );
  }
View Full Code Here

            }

            DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
            Node xslDOM = docBuilder.parse(new InputSource(xslFileName));

            stylesheet = tfactory.newTemplates(new DOMSource(xslDOM,
                    xslFileName));
          }
          else
          {
            // System.out.println("Calling newTemplates: "+xslFileName);
View Full Code Here

                    xslFileName));
          }
          else
          {
            // System.out.println("Calling newTemplates: "+xslFileName);
            stylesheet = tfactory.newTemplates(new StreamSource(xslFileName));
            // System.out.println("Done calling newTemplates: "+xslFileName);
          }
        }

        PrintWriter resultWriter;
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.