classpath) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@267692 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -127,10 +127,10 @@ public class XSLTProcess extends MatchingTask { | |||||
| if (liaison == null) { | if (liaison == null) { | ||||
| try { | try { | ||||
| setProcessor("xslp"); | setProcessor("xslp"); | ||||
| } catch (Exception e1) { | |||||
| } catch (Throwable e1) { | |||||
| try { | try { | ||||
| setProcessor("xalan"); | setProcessor("xalan"); | ||||
| } catch (Exception e2) { | |||||
| } catch (Throwable e2) { | |||||
| throw new BuildException(e2); | throw new BuildException(e2); | ||||
| } | } | ||||
| } | } | ||||
| @@ -71,12 +71,15 @@ public class XalanLiaison implements XSLTLiaison { | |||||
| XSLTProcessor processor; | XSLTProcessor processor; | ||||
| XSLTInputSource xslSheet; | XSLTInputSource xslSheet; | ||||
| public XalanLiaison() throws Exception { | |||||
| processor = XSLTProcessorFactory.getProcessor(); | |||||
| } | |||||
| public void setStylesheet(String fileName) throws Exception { | public void setStylesheet(String fileName) throws Exception { | ||||
| xslSheet = new XSLTInputSource (fileName); | xslSheet = new XSLTInputSource (fileName); | ||||
| }; | }; | ||||
| public void transform(String infile, String outfile) throws Exception { | public void transform(String infile, String outfile) throws Exception { | ||||
| if (processor == null) processor = XSLTProcessorFactory.getProcessor(); | |||||
| processor.process(new XSLTInputSource(infile), xslSheet, | processor.process(new XSLTInputSource(infile), xslSheet, | ||||
| new XSLTResultTarget(outfile)); | new XSLTResultTarget(outfile)); | ||||
| } | } | ||||
| @@ -72,13 +72,16 @@ public class XslpLiaison implements XSLTLiaison { | |||||
| XSLProcessor processor; | XSLProcessor processor; | ||||
| XSLStylesheet xslSheet; | XSLStylesheet xslSheet; | ||||
| public XslpLiaison() { | |||||
| processor = new XSLProcessor(); | |||||
| } | |||||
| public void setStylesheet(String fileName) throws Exception { | public void setStylesheet(String fileName) throws Exception { | ||||
| XSLReader xslReader = new XSLReader(); | XSLReader xslReader = new XSLReader(); | ||||
| xslSheet = xslReader.read( fileName ); | xslSheet = xslReader.read( fileName ); | ||||
| }; | }; | ||||
| public void transform(String infile, String outfile) throws Exception { | public void transform(String infile, String outfile) throws Exception { | ||||
| if (processor == null) processor = new XSLProcessor(); | |||||
| processor.process(infile, xslSheet, new FileWriter(outfile)); | processor.process(infile, xslSheet, new FileWriter(outfile)); | ||||
| } | } | ||||