Package javax.xml.transform

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


    ByteArrayOutputStream oOutputStream = new ByteArrayOutputStream();

    TransformerFactory oFactory = TransformerFactory.newInstance();
    StreamSource oStreamSrc = new StreamSource(oStyleSheetStream);
    Templates oTemplates = oFactory.newTemplates(oStreamSrc);
    Transformer oTransformer = oTemplates.newTransformer();

    if (null!=oProps) setParameters(oTransformer, oProps);
    StreamSource oStreamSrcXML = new StreamSource(oXMLInputStream);
    StreamResult oStreamResult = new StreamResult(oOutputStream);
    if (DebugFile.trace) DebugFile.writeln("Transformer.transform(StreamSource,StreamResult)");
View Full Code Here


        of transformation instructions, without penalizing runtime
        transformation.
      */
      Templates templates = transformerFactory.newTemplates( template );

      Transformer transformer = templates.newTransformer();
      if( outputProps != null )
      {
         transformer.setOutputProperties( outputProps );
      }

View Full Code Here

      StreamSource template = new StreamSource( templateIs );

      Templates templates = transformerFactory.newTemplates( template );

      // set output properties
      Transformer transformer = templates.newTransformer();
      if(outputProps != null)
      {
         transformer.setOutputProperties(outputProps);
      }
View Full Code Here

        TransformerFactory tf = TransformerFactory.newInstance();

        StreamSource source = new StreamSource(xsl);
        Templates templates = tf.newTemplates(source);

        Transformer trf = templates.newTransformer();

        trf.transform(new StreamSource(input), new StreamResult(output));
    }
}
View Full Code Here

          if (encoding == null && (method == null || ! method.equals("html")))
            encoding = "UTF-8";

          TransformerImpl transformer =
            (TransformerImpl) stylesheet.newTransformer();

          if (encoding != null)
            os.setEncoding(encoding);

          transformer.setProperty("caucho.pwd", Vfs.lookup());
View Full Code Here

          // is.close();
        }
       
        Transformer transformer = null;

        transformer = (Transformer) stylesheet.newTransformer();

        TransformerImpl cauchoTransformer = null;
        if (transformer instanceof TransformerImpl)
          cauchoTransformer = (TransformerImpl) transformer;
View Full Code Here

         The spec says: "a Transformer must use this interface
         instead of throwing an exception" - the newTemplates() does
         that, and returns null.
      */
      if( tmpl==null ) return null;
      Transformer transformer = tmpl.newTransformer();
      transformer.setURIResolver(m_uriResolver);
      return transformer;
    } catch( TransformerConfigurationException ex ) {
      if( m_errorListener != null ) {
        try {
View Full Code Here

          }
        }

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

          // Override the output format?
          if (null != outputType)
          {
            transformer.setOutputProperty(OutputKeys.METHOD, outputType);
View Full Code Here

            throws TransformerException, IOException, Exception
    {
        Templates styleTemplate = getTemplates(style);

        Transformer transformer = (styleTemplate != null)
                ? styleTemplate.newTransformer()
                : tfactory.newTransformer();

        if (params != null)
        {
            for (Iterator it = params.entrySet().iterator(); it.hasNext(); )
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

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.