From 93db46be115205107729104e728d45687d885295 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Mon, 28 Jan 2002 09:28:33 +0000 Subject: [PATCH] Xalan1 prolly wont be supported in next Ant git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270988 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/antlib/xml/XSLTProcess.java | 6 - .../org/apache/antlib/xml/XalanLiaison.java | 114 ------------------ 2 files changed, 120 deletions(-) delete mode 100644 proposal/myrmidon/src/java/org/apache/antlib/xml/XalanLiaison.java diff --git a/proposal/myrmidon/src/java/org/apache/antlib/xml/XSLTProcess.java b/proposal/myrmidon/src/java/org/apache/antlib/xml/XSLTProcess.java index 73179c612..40aa2af7f 100644 --- a/proposal/myrmidon/src/java/org/apache/antlib/xml/XSLTProcess.java +++ b/proposal/myrmidon/src/java/org/apache/antlib/xml/XSLTProcess.java @@ -494,12 +494,6 @@ public class XSLTProcess loadClass( "org.apache.tools.ant.taskdefs.optional.TraXLiaison" ); m_liaison = (XSLTLiaison)clazz.newInstance(); } - else if( proc.equals( "xalan" ) ) - { - final Class clazz = - loadClass( "org.apache.tools.ant.taskdefs.optional.XalanLiaison" ); - m_liaison = (XSLTLiaison)clazz.newInstance(); - } else { m_liaison = (XSLTLiaison)loadClass( proc ).newInstance(); diff --git a/proposal/myrmidon/src/java/org/apache/antlib/xml/XalanLiaison.java b/proposal/myrmidon/src/java/org/apache/antlib/xml/XalanLiaison.java deleted file mode 100644 index 6f42bd0a8..000000000 --- a/proposal/myrmidon/src/java/org/apache/antlib/xml/XalanLiaison.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE.txt file. - */ -package org.apache.antlib.xml; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import org.apache.myrmidon.api.TaskException; -import org.apache.xalan.xslt.XSLTInputSource; -import org.apache.xalan.xslt.XSLTProcessor; -import org.apache.xalan.xslt.XSLTProcessorFactory; -import org.apache.xalan.xslt.XSLTResultTarget; - -/** - * Concrete liaison for Xalan 1.x API. - * - * @author Sam Ruby - * @author Stephane Bailliez - */ -public class XalanLiaison - implements XSLTLiaison -{ - private XSLTProcessor processor; - private File stylesheet; - - public XalanLiaison() - throws Exception - { - processor = XSLTProcessorFactory.getProcessor(); - } - - public void setOutputtype( String type ) - throws Exception - { - if( !type.equals( "xml" ) ) { - throw new TaskException( "Unsupported output type: " + type ); - } - } - - public void setStylesheet( File stylesheet ) - throws Exception - { - this.stylesheet = stylesheet; - } - - public void addParam( String name, String value ) - { - processor.setStylesheetParam( name, value ); - } - - public void transform( File infile, File outfile ) - throws Exception - { - FileInputStream fis = null; - FileOutputStream fos = null; - FileInputStream xslStream = null; - try - { - xslStream = new FileInputStream( stylesheet ); - fis = new FileInputStream( infile ); - fos = new FileOutputStream( outfile ); - // systemid such as file:/// + getAbsolutePath() are considered - // invalid here... - XSLTInputSource xslSheet = new XSLTInputSource( xslStream ); - xslSheet.setSystemId( stylesheet.getAbsolutePath() ); - XSLTInputSource src = new XSLTInputSource( fis ); - src.setSystemId( infile.getAbsolutePath() ); - XSLTResultTarget res = new XSLTResultTarget( fos ); - processor.process( src, xslSheet, res ); - } - finally - { - // make sure to close all handles, otherwise the garbage - // collector will close them...whenever possible and - // Windows may complain about not being able to delete files. - try - { - if( xslStream != null ) - { - xslStream.close(); - } - } - catch( IOException ignored ) - { - } - try - { - if( fis != null ) - { - fis.close(); - } - } - catch( IOException ignored ) - { - } - try - { - if( fos != null ) - { - fos.close(); - } - } - catch( IOException ignored ) - { - } - } - } -}//-- XalanLiaison