Examples of TransformerFactory


Examples of javax.xml.transform.TransformerFactory

  FileNotFoundException, IOException, Exception {
   
    if ( stream == null throw (new Exception("SOSXMLTransformer: no xml document contained in stream." ));
    if ( !xslFile.exists() )  throw (new Exception("SOSXMLTransformer: no file found containing stylesheet." ));
   
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile));
    addParameters(transformer, parameters);
    transformer.transform(new StreamSource(stream),
        new StreamResult(new FileOutputStream(outputFile)));
  }
View Full Code Here

Examples of javax.xml.transform.TransformerFactory

    if ( !inputFile.exists() )  throw (new Exception("SOSXMLTransformer: no file found containing xml document." ));
   
   
    StreamSource stream = new StreamSource(inputFile);
   
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source stylesheet = tFactory.getAssociatedStylesheet(stream, null, null, null);
   
    if ( stylesheet == null throw (new Exception("SOSXMLTransformer: no stylesheet found in input file." ));
   
    Transformer transformer = tFactory.newTransformer(stylesheet);
    addParameters(transformer, parameters);
    transformer.transform(stream,
        new StreamResult(new FileOutputStream(outputFile)));
  }
View Full Code Here

Examples of org.apache.sling.rewriter.TransformerFactory

     * Get the transformer of the given type.
     * @param type The transformer type.
     * @return The transformer or null if the transformer is not available.
     */
    public Transformer getTransformer(final String type) {
        final TransformerFactory factory = this.transformerTracker.getFactory(type);
        if ( factory == null ) {
            LOGGER.debug("Requested transformer factory for type '{}' not found.", type);
            return null;
        }
        return factory.createTransformer();
    }
View Full Code Here

Examples of org.salamandra.web.spring.config.TransformerFactory

    if (LOG.isInfoEnabled()) {
      LOG.info("Loading XML bean definitions from " + actualLocation + "");
    }

    InputStream is = null;
    TransformerFactory transformerFactory = null;
    try {
      is = actualLocation.getInputStream();
      transformerFactory = new TransformerFactory(getServletContext(), is);
     
     
    } catch (IllegalStateException ex) {
      throw new BeanInitializationException(
          "IllegalStateException parsing XML document from "
View Full Code Here

Examples of org.salamandra.web.struts.config.TransformerFactory

  public synchronized void init(ActionServlet actionServlet, ModuleConfig moduleConfig) throws ServletException {
    super.init(actionServlet, moduleConfig);
    try {
      if (transformerFactory == null)
        transformerFactory = new TransformerFactory(actionServlet, moduleConfig);
    } catch (SalamandraConfigException e) {
      throw new ServletException(e);
    }
  }
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.