Package javax.xml.transform

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


   * could not be built
   */
  protected Transformer buildTransformer(Map parameters) throws TransformerConfigurationException {
    Templates templates = getTemplates();
    Transformer transformer =
        (templates != null ? templates.newTransformer() : getTransformerFactory().newTransformer());
    applyTransformerParameters(parameters, transformer);
    return transformer;
  }

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

      PrintWriter pw = new PrintWriter(new StringWriter());

      synchronized (m_tfactory)
      {
        Templates templates = m_tfactory.newTemplates(new StreamSource(xslbuf));
        Transformer transformer = templates.newTransformer();
        transformer.transform(new StreamSource(xmlbuf), new StreamResult(pw));
      }
      System.out.println("Primed the pump!");
      this.showStatus("Ready to go!");
    }
View Full Code Here

                                Source xml = new StreamSource(inputXml);
                                Source xsl = new StreamSource(xslResource.toExternalForm());
                                final StreamResult streamResult;
                                final Templates templates = TransformerFactory.newInstance().newTemplates(xsl);
                                streamResult = new StreamResult(pipedOut);
                                templates.newTransformer().transform(xml, streamResult);
                            } catch (TransformerConfigurationException e) {
                                throw new RuntimeException("Error initializing XSL transformer", e);
                            } catch (TransformerException e) {
                                throw new RuntimeException("Error transforming", e);
                            } finally {
View Full Code Here

      tm = _templateCache.get(new MultiKey(baseUri, uri));
    }
    if (tm == null)
      throw new XslTransformException("XSL sheet" + uri + " has not been parsed before transformation!");
    try {
      Transformer tf = tm.newTransformer();
      tf.setURIResolver(resolver);
      if (parameters != null) {
        for (Map.Entry<QName, Object> param : parameters.entrySet()) {
          tf.setParameter(param.getKey().getLocalPart(), param.getValue());
        }
View Full Code Here

   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

   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

               if (stream != null)
               {
                  if (logger.isEnabledFor(Logger.DEBUG)) logger.debug("Creating template for path " + path);
                  Templates template = factory.newTemplates(new StreamSource(stream));
                  if (useCache) templatesCache.put(path, template);
                  return template.newTransformer();
               }
               else
               {
                  if (logger.isEnabledFor(Logger.INFO)) logger.info("XSL template for path '" + path + "' not found");
               }
View Full Code Here

        Source XsltWsdlDocument = new StreamSource(wsdlInputStream);
        Templates templates = createTemplatesFor
            (endpointsCopy, wsdlRelativeImports, wsdlIncludes,
                schemaRelativeImports, schemaIncludes);
                                                
        Transformer transformer = templates.newTransformer();


        // WSDL is associated with webservice, but url is endpoint-specific,
        // so let WebService choose which endpoint to use.
        WebServiceEndpoint endpointForImport =
View Full Code Here

        Source XsltWsdlDocument = new StreamSource(wsdlInputStream);
        Templates templates = createTemplatesFor
            (endpointsCopy, wsdlRelativeImports, wsdlIncludes,
                schemaRelativeImports, schemaIncludes);
                                                
        Transformer transformer = templates.newTransformer();


        // WSDL is associated with webservice, but url is endpoint-specific,
        // so let WebService choose which endpoint to use.
        WebServiceEndpoint endpointForImport =
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.