Hi,

    I made the changes described below to move the compilation from 
TransletTemplates#newTransformer() into 
TransformerFactoryInpl#newTemplates() and I find that where the 
Templates object is created once and Transformers created from the 
Templates as required it was about twice as fast.

    I'm attaching the files. If you think it is a useful change I'll 
make patch files.

        Regards,

            Padraig

Padraig O'hIceadha wrote:

> Hi Gary, Morten,
>
>     We were looking at caching a Templates object for reuse with XSLTC 
> but were a little confused in that it is the newTransformer that does 
> the compilation. The class compiled (the translet) seems to be a 
> Transformer. So caching the Template object is not much use.
>
>     One critical aspect of Templates is that they are thread safe. I 
> presume Translets are not ?
>
>     Is it safe as a workaround to :
>
>    1. after calling newTransformer for the first time cast the result
>       back to AbstractTranslet and cache the result of
>       getTransletName() and the result of
>       calling Class.forName(transletName);
>    2. then while the cache is not dirty instead of calling
>       newTransformer again do
>          1. Class transletClass = <read Class from cache (or do the
>             Class.forName again)>
>          2. translet = (Translet)transletClass.newInstance();
>          3. ((AbstractTranslet)translet).setTransletName(<read name
>             from cache>);
>
>     Is it likely that Xsltc will change so that the Translet class is 
> not a Transformer ?
>
>     Or is it likely that the compilation will move soon to 
> newTemplates with the TransletTemplates class retaining the Class 
> object and the class name and TransletTemplates#newTransformer change 
> to doing a newInstance on the stored Class and then setting the 
> translet name ? All the code exists for this, it would just need to be 
> re-organised a little.
>
>     Two new instance variables (transletName, transletClass) could be 
> added to store the Classs and its name. The first half of 
> TransletTemplates#newTransformer() could  move to the constructor with 
> the only change being that transletName would no longer be local it 
> would be one of the instance variables.
>
>     The second half of that method would stay where it is with the 
> changes that it also would use this.tansletName and this.transletClass 
> rather than doing a classForName.
>
>     TransformerFactoryInpl#newTransformer(Source source) would then be 
> something like
>
>     Templates tmpl=newTemplates( source );
>     if( tmpl==null ) return null;
>     return tmpl.newTransformer();
>
>     Does this make sense ?
>
>         Regards,
>
>             Padraig
>
> Gary L Peskin wrote:
>
>>Morten --
>>
>>I may be missing something here and I'm sure Scott will jump in but here
>>is my understanding of things.  I don't really think that TRaX has "...
>>loads of crap ... that most users will never bother even looking at" but
>>I could be wrong there too.
>>
>>Basically, 
>>
>>  Templates <==> Translet class
>>  Transfomer <==> Translet object/instance
>>
>>You say that "the current code wraps the translet (or actually the
>>translet base class) inside a transformer object."  In TRaX terms, this
>>should really be in a Templates object.  Once inside the Templates
>>object, the user can cache this to his or her content.  Switching to a
>>TRAX-conformant XSLTC will allow the user to use the caching strategy
>>already in place.
>>
>>Now, when a transform is desired, the user creates a Transformer from
>>the Templates object by calling Templates.newTransformer().  This is
>>just creating a newInstance() of the Translet embodied in the Templates
>>object.  This should be a lightweight operation, not requiring a
>>recompilation like the current Transformer generation but just a new
>>instance of the translet.
>>
>>I think that part of the confusion stems from the fact that there are
>>two ways to get a transformer in TRaX:
>>
>>  TransformerFactory.newTransformer(Source)
>>-and-
>>  TransformerFactory.newTemplates(Source) -followed by-
>>  Templates.newTransformer()
>>
>>The first method is good for one-shot prototypes or other applications
>>where there is no need to maintain the translet -class- for multiple
>>invocations.  The second method is used for industrial strength
>>applications where we compile once and then execute instances lots of
>>times.
>>
>>It sounds like you're currently doing your compiling in
>>Templates.newTransformer() but that is not where it should be
>>happening.  It should be happening in
>>TransformerFactor.newTemplates(Source).
>>
>>If you already realized this, then I've completely misunderstood
>>everyone's point and I'll just go away.  Otherwise, please come back
>>with any questions.
>>
>>Thanks,
>>Gary
>>
>>Morten Jorgensen wrote:
>>
>>>[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> wrote:
>>>
>>>>Morten Jorgensen <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]> 
>wrote:
>>>>
>>>>>and we don't want to compile such classes more often
>>>>>than we have to, and this is the reason why we want
>>>>>cache translets.
>>>>>
>>>>My position is that the XSLT processor should not be doing caching.
>>>>I have said this many times and I will continue to say it.
>>>>
>>>Why would anyone bother to use compiled stylesheets if they have to
>>>be compiled for every transformation (or sequence of transformations)?
>>>There is not reason at all to use XSLTC if translets are not pre-
>>>compiled and stored. XSLTC spends ca. 4 times as long to compile a
>>>translet as any other XSLT processor uses on a transformation. If our
>>>JAXP implementation forces a compilation for each time a translet is
>>>loaded we would make XSLTC the slowest XSLT processor on the market.
>>>If XSLTC is made the slowest JAXP compliant processor there is, then
>>>I don't think many people will bother use it - except for those that
>>>are still using its native APIs - and there would be no reason to
>>>add JAXP support at all.
>>>
>>>>Here's how it should work in my opinion:
>>>>
>>>>org.apache.xalan.xsltc.compiler.XSLTC should implement javax.xml.transform.
>>>>TransformerFactory.
>>>>org.apache.xalan.xsltc.compiler.XSLTC#newTemplates(Source source) should
>>>>compile the source object into a Translets, and create a small wrapper
>>>>class, org.apache.xalan.xslt.TemplatesImpl that contains the Class object,
>>>>or perhaps just the class name (or, perhaps you get fancier than that and
>>>>it holds the actual bytecodes... dunno).
>>>>
>>>There are still loads of people that prefer to use the native APIs of XSLTC.
>>>Many of these users stick to XSLTC because of its small footprint, and not
>>>so much for performance reasons. I would like to separate the JAXP/TrAX
>>>wrappers from the existing XSLTC source tree (leaving the existing code
>>>untouched - for now) and putting all TrAX wrappers in a separate directory:
>>>
>>> a) org.apache.xalan.xsltc.runtime - existing code
>>> b) org.apache.xalan.xsltc.dom     - internal DOM
>>> c) org.apache.xalan.xsltc.trax    - TrAX wrappers/etc.
>>>
>>>There is loads of crap in TrAX that most users will never bother even looking
>>>at. I don't want to force this stuff upon those users that are more than
>>>happy to use just a) and b) above (this is the case for those that are using
>>>XSLTC in applets). I know that the current code wraps the translet (or actually
>>>the translet base class) inside a transformer object. Nowmatter how fancy this
>>>looks on a design diagram it is not desireably/practical for many users.
>>>
>>>>Everytime the caller calls TransformerFactory#newTemplates(Source source),
>>>>org.apache.xalan.xsltc.compiler.XSLTC#newTemplates(Source source) will
>>>>compile a new Translet, period.  Caching that object is the responsibility
>>>>of the caller, which can use whatever mechanisms are suitible.
>>>>
>>>>org.apache.xalan.xslt.TemplatesImpl#newTransformer() should simply call
>>>>Class#newInstance() on the the contained Translet class object.
>>>>
>>>>This seems really simple to me.  Applications that are already caching
>>>>Templates objects then start caching XSLTC translets automatically, with
>>>>the same mechanism.
>>>>
>>>Sure, users can cache Template instances as much as they want to nomatter
>>>what is wrapped in inside the Template. But, this means that the stylesheet
>>>is compiled every time the user wants to instanciate a translet _object_.
>>>This, again, undermines the whole idea of compiling stylesheets.
>>>
>>>Most of the software I use is open-source and is distributed as source code.
>>>I compile this software once, store it as binaries and load it into memory
>>>when I need it. I do not compile it every time I run it and then keep it
>>>memory for as long as I can. This is mainly for two reasons:
>>>
>>> a) I don't want to wait for it to compile every time I load it
>>> b) I do not have enough memory on my PC to keep it in memory at all times
>>>
>>>This holds for translets too. A web server that uses XSLTC would proably
>>>not be able to keep Template/Transformer objects for all stylesheets in
>>>memory at all times. Neither would it be preferrable to compile stylesheets
>>>every time a new Transformer/Template object is instanciated.
>>>
>>>>>Our main concern is where to store the translets (a simple Java
>>>>>property file pointing to a directory may do)
>>>>>
>>>>Does the class have to be put on disk?  (A question... I simply don't
>>>>know).  If it does, I guess I would use a system property to indicate the
>>>>storage directory.
>>>>
>>>Yes, we absolutely, definately need to be able to store translet
>>>_classes_ somewhere. A simple property could be used. If the property we
>>>use is set, then translets can be cached in the directory (or whatever)
>>>the property points to, otherwise caching is turned off.
>>>
>>>>>and how to make sure that a translet in the cache is still valid
>>>>>
>>>>This is one of the reasons you really shouldn't muck with caching.
>>>>Whatever you do will cause somebody problems.  Put this responsibility at
>>>>the application level where it belongs.
>>>>
>>>Template/Transformer caching definately belongs at the application level.
>>>How these objects are created is our responsibility. And we want to create
>>>them as efficiently as we can.
>>>
>>>Morten
>>>
>>
>>
>
>


/*
 * @(#)$Id: TransletTemplates.java,v 1.2 2001/06/27 18:47:04 tmiller Exp $
 *
 * The Apache Software License, Version 1.1
 *
 *
 * Copyright (c) 2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Xalan" and "Apache Software Foundation" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called "Apache",
 *    nor may "Apache" appear in their name, without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation and was
 * originally based on software copyright (c) 2001, Sun
 * Microsystems., http://www.sun.com.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 * @author G. Todd Miller 
 *
 */
package org.apache.xalan.xsltc.trax;

import javax.xml.transform.Templates;
import javax.xml.transform.Source; 
import javax.xml.transform.stream.StreamSource; 
import javax.xml.transform.Transformer; 
import javax.xml.transform.TransformerConfigurationException; 
import javax.xml.transform.sax.SAXTransformerFactory; 

import org.apache.xalan.xsltc.runtime.AbstractTranslet;
import org.apache.xalan.xsltc.compiler.XSLTC;
import org.apache.xalan.xsltc.compiler.CompilerException;
import org.apache.xalan.xsltc.compiler.util.Util;
import org.apache.xalan.xsltc.Translet;
import java.util.Properties;

import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.net.MalformedURLException;

/**
 * Implementation of a JAXP1.1 Templates object for Translets.
 */ 
public class TransletTemplates implements Templates
{
    private Source _stylesheet;
	private String transletName;
	private Class transletClass;

    public TransletTemplates(Source stylesheet) throws
       TransformerConfigurationException
	{
		_stylesheet = stylesheet;
        XSLTC xsltc = new XSLTC();
        xsltc.init();

        // check if destination has been set with system property
        String transletDestDir = System.getProperty("transletPool");
        if (transletDestDir != null) {
            try {
                xsltc.setDestDirectory(transletDestDir);
            } catch(CompilerException e)  {
                throw new TransformerConfigurationException(
                    "System property 'transletPool' was set to  " +
                    transletDestDir + ", " + e );
            }
        }


	// compile stylesheet
	boolean isSuccessful = true;
	StreamSource strmsrc = (StreamSource)_stylesheet;
	InputStream inputStream = strmsrc.getInputStream();
	String stylesheetName = _stylesheet.getSystemId();
	transletName = "no_name";
	if (inputStream != null) {
	    isSuccessful = xsltc.compile(inputStream, transletName);
	} else if (stylesheetName != null ){
/******************
	    int index = stylesheetName.indexOf('.');
	    if (index > 0) { 
                transletName = stylesheetName.substring(0,index);
            }
            else {
                // indexOf returns -1 if '.' is not present
                transletName = stylesheetName;
            }   
********************/
	    transletName = Util.toJavaName(Util.noExtName(
                Util.baseName(stylesheetName)));
            try {
                if (stylesheetName.startsWith("file:/")) {
                    isSuccessful = xsltc.compile(new URL(stylesheetName));
                } else {
                    File file = new File(stylesheetName);
                    URL url = file.toURL();
                    isSuccessful = xsltc.compile(url);
                }
            } catch (MalformedURLException e) {
                throw new TransformerConfigurationException(
                    "URL for stylesheet '" + stylesheetName +
                    "' can not be formed.");
	    }
        } else {
	   throw new TransformerConfigurationException(
		"Stylesheet must have a system id or be an InputStream.");
	}

        if (!isSuccessful) {
            throw new TransformerConfigurationException(
                "Compilation of stylesheet '" + stylesheetName + "' failed.");
        }

         try {
            transletClass = Class.forName(transletName);
        } catch (ClassNotFoundException e) {
            throw new TransformerConfigurationException(
                "Translet class '" + transletName + "' not found.");
        }
   }

    public Transformer newTransformer() throws 
	TransformerConfigurationException
    {
        Translet translet = null;
        try {
            translet = (Translet)transletClass.newInstance();
            ((AbstractTranslet)translet).setTransletName(transletName);
        } catch (InstantiationException e) {
            throw new TransformerConfigurationException(
                "Translet class '" + transletName +
                "' could not be instantiated");
        } catch (IllegalAccessException  e) {
            throw new TransformerConfigurationException(
                "Translet class '" + transletName + "' could not be accessed.");
        }
        return (AbstractTranslet)translet;
    }

    public Properties getOutputProperties() { 
	/*TBD*/ 
	return new Properties(); 
    }

}
/*
 * @(#)$Id: TransformerFactoryImpl.java,v 1.3 2001/06/27 18:46:40 tmiller Exp $
 *
 * The Apache Software License, Version 1.1
 *
 *
 * Copyright (c) 2001 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Xalan" and "Apache Software Foundation" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called "Apache",
 *    nor may "Apache" appear in their name, without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation and was
 * originally based on software copyright (c) 2001, Sun
 * Microsystems., http://www.sun.com.  For more
 * information on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 *
 * @author G. Todd Miller 
 *
 */


package org.apache.xalan.xsltc.trax;

import javax.xml.transform.Templates; 
import javax.xml.transform.Transformer; 
import javax.xml.transform.TransformerException; 
import javax.xml.transform.ErrorListener; 
import javax.xml.transform.Source; 
import javax.xml.transform.stream.StreamSource; 
import javax.xml.transform.stream.StreamResult; 
import javax.xml.transform.URIResolver; 
import javax.xml.transform.TransformerConfigurationException; 
import javax.xml.transform.sax.SAXTransformerFactory; 
import javax.xml.transform.sax.TemplatesHandler;
import javax.xml.transform.sax.TransformerHandler;

import org.xml.sax.XMLFilter;

import org.apache.xalan.xsltc.Translet;
import org.apache.xalan.xsltc.compiler.XSLTC;
import org.apache.xalan.xsltc.compiler.CompilerException;
import org.apache.xalan.xsltc.compiler.util.Util;
import org.apache.xalan.xsltc.runtime.AbstractTranslet;

import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.net.MalformedURLException;


/**
 * Implementation of a JAXP1.1 SAXTransformerFactory for Translets.
 */
public class TransformerFactoryImpl extends SAXTransformerFactory {
    public TransformerFactoryImpl() { /* nothing yet */ }

    ////////////////////////////////////////////////////// 
    // SAXTransformerFactory (subclass of TransformerFactory)
    //
    public TemplatesHandler newTemplatesHandler() 
	throws TransformerConfigurationException 
    { 
	/*TBD*/
	throw new TransformerConfigurationException(
	    "TransformerFactoryImpl:newTemplatesHandler() " +
	    "not implemented yet."); 
	//return null; 
    }
    public TransformerHandler newTransformerHandler() 
	throws TransformerConfigurationException 
    {
	/*TBD*/ 
        throw new TransformerConfigurationException(
            "TransformerFactoryImpl:newTransformerHandler() " +
            "not implemented yet."); 
	// return null; 
    }
    public TransformerHandler newTransformerHandler(Source src) 
	throws TransformerConfigurationException 
    { 
        /*TBD*/ 
        throw new TransformerConfigurationException(
            "TransformerFactoryImpl:newTransformerHandler(Source) " +
            "not implemented yet."); 
	// return null; 
    }
    public TransformerHandler newTransformerHandler(Templates templates) 
	throws TransformerConfigurationException 
    { 
        /*TBD*/ 
        throw new TransformerConfigurationException(
            "TransformerFactoryImpl:newTransformerHandler(Templates) " +
            "not implemented yet."); 
	//return null; 
    }


  /**
   * Create an XMLFilter that uses the given source as the
   * transformation instructions.
   *
   * @param src The source of the transformation instructions.
   *
   * @return An XMLFilter object, or null if this feature is not supported.
   *
   * @throws TransformerConfigurationException
   */
    public XMLFilter newXMLFilter(Source src) 
	throws TransformerConfigurationException 
    {
	Templates templates = newTemplates(src);
	if (templates == null ) {
	    return null; 
	}
	return newXMLFilter(templates);
    }

    public XMLFilter newXMLFilter(Templates templates) 
	throws TransformerConfigurationException 
    {
	try {
      	    return new org.apache.xalan.xsltc.trax.TrAXFilter(templates);
    	} catch( TransformerConfigurationException ex ) {
      	    if( _errorListener != null) {
                try {
          	    _errorListener.fatalError( ex );
          	    return null;
        	} catch( TransformerException ex1 ) {
          	    new TransformerConfigurationException(ex1);
        	}
      	    }
      	    throw ex;
    	}
    }
    //
    // End SAXTransformerFactory methods 
    ////////////////////////////////////////////////////// 

    ////////////////////////////////////////////////////// 
    // TransformerFactory
    //
    public ErrorListener getErrorListener() { 
	return _errorListener;
    }

    public void setErrorListener(ErrorListener listener) 
	throws IllegalArgumentException
    {
	if (listener == null) {
            throw new IllegalArgumentException(
               "Error: setErrorListener() call where ErrorListener is null");
	}
	_errorListener = listener;
    }

    public Object getAttribute(String name) 
	throws IllegalArgumentException
    { 
	/*TBD*/ 
        throw new IllegalArgumentException(
            "TransformerFactoryImpl:getAttribute(String) " +
            "not implemented yet.");
	//return null; 
    }
    public void setAttribute(String name, Object value) 
	throws IllegalArgumentException
    { 
	/*TBD*/  
        throw new IllegalArgumentException(
            "TransformerFactoryImpl:getAttribute(String) " +
            "not implemented yet.");
    }
    public boolean getFeature(String name) { 
	if ((StreamSource.FEATURE == name) ||
	    (StreamResult.FEATURE == name) ||
	    (SAXTransformerFactory.FEATURE == name)) {
	    return true;
	} else if ((StreamSource.FEATURE.equals(name))
		|| (StreamResult.FEATURE.equals(name))
		|| (SAXTransformerFactory.FEATURE.equals(name))) {
	    return true;
	} else {
 	    return false; 
	}
    } 
    public URIResolver getURIResolver() { /*TBD*/ return null; } 
    public void setURIResolver(URIResolver resolver) {/*TBD*/   } 
    public Source getAssociatedStylesheet(Source src, String media,
	String title, String charset)  throws TransformerConfigurationException
    { 
	/*TBD*/ 
        throw new TransformerConfigurationException(
            "TransformerFactoryImpl:getAssociatedStylesheet(Source,String," +
            "String, String) not implemented yet.");
	//return null; 
    }
    public Transformer newTransformer() throws
	TransformerConfigurationException 
    { 
	/*TBD*/ 
        throw new TransformerConfigurationException(
            "TransformerFactoryImpl:newTransformer() " +
            " not implemented yet.");
	//return null; 
    }
    //
    // End TransformerFactory methods 
    ////////////////////////////////////////////////////// 


    public Transformer newTransformer(Source stylesheet) throws
	TransformerConfigurationException
    {
      Templates tmpl=newTemplates( stylesheet );
      if( tmpl==null ) return null;
      Transformer transformer = tmpl.newTransformer();
      return transformer;
	}
	
    public Templates newTemplates(Source stylesheet) throws
       TransformerConfigurationException 
    {
	return new TransletTemplates(stylesheet);
    }

    private ErrorListener _errorListener = null; 
}

Reply via email to