FileDocCategorySizeDatePackage
Xalan2Executor.javaAPI DocApache Ant 1.703719Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs.optional.junit

Xalan2Executor

public class Xalan2Executor extends XalanExecutor
This class is not used by the framework any more. We plan to remove it in Ant 1.8
deprecated
since Ant 1.7
ant.task
ignore="true"

Fields Summary
private static final String
APAC
private static final String
SPAC
private TransformerFactory
tfactory
Constructors Summary
Methods Summary
voidexecute()
{@inheritDoc}.

        String systemId = caller.getStylesheetSystemId();
        Source xslSrc = new StreamSource(systemId);
        Transformer tformer = tfactory.newTransformer(xslSrc);
        Source xmlSrc = new DOMSource(caller.document);
        OutputStream os = getOutputStream();
        try {
            tformer.setParameter("output.dir", caller.toDir.getAbsolutePath());
            Result result = new StreamResult(os);
            tformer.transform(xmlSrc, result);
        } finally {
            os.close();
        }
    
protected java.lang.StringgetImplementation()
{@inheritDoc}.


      
         
        return tfactory.getClass().getName();
    
protected java.lang.StringgetProcVersion(java.lang.String classNameImpl)
{@inheritDoc}.

        try {
            // xalan 2
            if (classNameImpl.equals(APAC + "processor.TransformerFactoryImpl")
                ||
                classNameImpl.equals(APAC + "xslt.XSLTProcessorFactory")) {
                return getXalanVersion(APAC + "processor.XSLProcessorVersion");
            }
            // xalan xsltc
            if (classNameImpl.equals(APAC
                                     + "xsltc.trax.TransformerFactoryImpl")) {
                return getXSLTCVersion(APAC + "xsltc.ProcessorVersion");
            }
            // jdk 1.5 xsltc
            if (classNameImpl
                .equals(SPAC + "internal.xsltc.trax.TransformerFactoryImpl")) {
                return getXSLTCVersion(SPAC
                                       + "internal.xsltc.ProcessorVersion");
            }
            throw new BuildException("Could not find a valid processor version"
                                     + " implementation from "
                                     + classNameImpl);
        } catch (ClassNotFoundException e) {
            throw new BuildException("Could not find processor version "
                                     + "implementation", e);
        }