Bugzilla 23455. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@395723 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -74,6 +74,9 @@ Changes that could break older environments: | |||||
| * A bug in SQLExec would prevent the execution of trailing, | * A bug in SQLExec would prevent the execution of trailing, | ||||
| non-semicolon-delimited statements. Bugzilla Report 37764. | non-semicolon-delimited statements. Bugzilla Report 37764. | ||||
| * support for the XSL:P XML parser has been removed. | |||||
| Bugzilla Report 23455. | |||||
| Fixed bugs: | Fixed bugs: | ||||
| ----------- | ----------- | ||||
| @@ -209,10 +209,6 @@ | |||||
| </or> | </or> | ||||
| </selector> | </selector> | ||||
| <selector id="needs.xslp"> | |||||
| <filename name="${optional.package}/XslpLiaison*"/> | |||||
| </selector> | |||||
| <selector id="needs.apache-resolver"> | <selector id="needs.apache-resolver"> | ||||
| <filename name="${apache.resolver.type.package}/**"/> | <filename name="${apache.resolver.type.package}/**"/> | ||||
| </selector> | </selector> | ||||
| @@ -419,9 +415,6 @@ | |||||
| <available resource="META-INF/services/javax.xml.transform.TransformerFactory"/> | <available resource="META-INF/services/javax.xml.transform.TransformerFactory"/> | ||||
| </or> | </or> | ||||
| </condition> | </condition> | ||||
| <available property="xslp.present" | |||||
| classname="com.kvisco.xsl.XSLProcessor" | |||||
| classpathref="classpath"/> | |||||
| <available property="apache.resolver.present" | <available property="apache.resolver.present" | ||||
| classname="org.apache.xml.resolver.tools.CatalogResolver" | classname="org.apache.xml.resolver.tools.CatalogResolver" | ||||
| classpathref="classpath"/> | classpathref="classpath"/> | ||||
| @@ -682,7 +675,6 @@ | |||||
| <selector refid="needs.trax" unless="trax.present"/> | <selector refid="needs.trax" unless="trax.present"/> | ||||
| <selector refid="needs.xalan1" unless="xalan.present"/> | <selector refid="needs.xalan1" unless="xalan.present"/> | ||||
| <selector refid="needs.xslp" unless="xslp.present"/> | |||||
| <selector refid="needs.apache-resolver" unless="apache.resolver.present"/> | <selector refid="needs.apache-resolver" unless="apache.resolver.present"/> | ||||
| <selector refid="needs.junit" unless="junit.present"/> | <selector refid="needs.junit" unless="junit.present"/> | ||||
| <selector refid="needs.apache-regexp" | <selector refid="needs.apache-regexp" | ||||
| @@ -865,7 +857,6 @@ | |||||
| <or> | <or> | ||||
| <selector refid="needs.trax"/> | <selector refid="needs.trax"/> | ||||
| <selector refid="needs.xalan1"/> | <selector refid="needs.xalan1"/> | ||||
| <selector refid="needs.xslp"/> | |||||
| <selector refid="needs.apache-resolver"/> | <selector refid="needs.apache-resolver"/> | ||||
| <selector refid="needs.junit"/> | <selector refid="needs.junit"/> | ||||
| <selector refid="needs.apache-regexp"/> | <selector refid="needs.apache-regexp"/> | ||||
| @@ -913,7 +904,6 @@ | |||||
| <optional-jar dep="trax"/> | <optional-jar dep="trax"/> | ||||
| <optional-jar dep="xalan1"/> | <optional-jar dep="xalan1"/> | ||||
| <optional-jar dep="xslp"/> | |||||
| <optional-jar dep="apache-resolver"/> | <optional-jar dep="apache-resolver"/> | ||||
| <optional-jar dep="junit"/> | <optional-jar dep="junit"/> | ||||
| <optional-jar dep="apache-regexp"/> | <optional-jar dep="apache-regexp"/> | ||||
| @@ -1737,8 +1727,6 @@ | |||||
| unless="bsf.present"/> | unless="bsf.present"/> | ||||
| <exclude name="${optional.package}/XalanLiaisonTest.java" | <exclude name="${optional.package}/XalanLiaisonTest.java" | ||||
| unless="xerces1.present"/> | unless="xerces1.present"/> | ||||
| <exclude name="${optional.package}/XslpLiaisonTest.java" | |||||
| unless="xerces1.present"/> | |||||
| <exclude name="${ant.package}/IncludeTest.java" | <exclude name="${ant.package}/IncludeTest.java" | ||||
| unless="xerces1.present"/> | unless="xerces1.present"/> | ||||
| <exclude name="${type.package}/selectors/ModifiedSelectorTest.java" | <exclude name="${type.package}/selectors/ModifiedSelectorTest.java" | ||||
| @@ -50,10 +50,7 @@ attribute) the implicit fileset formed by this task.</p> | |||||
| <p>This task supports the use of a nested <code><param></code> element which is used to pass values | <p>This task supports the use of a nested <code><param></code> element which is used to pass values | ||||
| to an <code><xsl:param></code> declaration.</p> | to an <code><xsl:param></code> declaration.</p> | ||||
| <p>This task supports the use of a nested <a href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> | <p>This task supports the use of a nested <a href="../CoreTypes/xmlcatalog.html">xmlcatalog</a> | ||||
| element which is used to perform Entity and URI resolution</p> | |||||
| <p><i><code><style></code> and <code><xslt></code> refer to the same Ant task and can be used interchangeably.</i></p> | |||||
| <p>If you want to use Xalan-J 1 or XSL:P, you also Ant optional JARs, | |||||
| specifically ant-xalan1.jar and ant-xslp.jar</p> | |||||
| element which is used to perform Entity and URI resolution.</p> | |||||
| <h3>Parameters</h3> | <h3>Parameters</h3> | ||||
| <table border="1" cellpadding="2" cellspacing="0"> | <table border="1" cellpadding="2" cellspacing="0"> | ||||
| <tr> | <tr> | ||||
| @@ -83,9 +80,12 @@ element which is used to perform Entity and URI resolution</p> | |||||
| <tr> | <tr> | ||||
| <td valign="top">style</td> | <td valign="top">style</td> | ||||
| <td valign="top">name of the stylesheet to use - given either relative | <td valign="top">name of the stylesheet to use - given either relative | ||||
| to the project's basedir or as an absolute path | |||||
| <em><strong>DEPRECATED</strong> - can be specified as a path relative | |||||
| to the basedir attribute of this task as well</em>. | |||||
| to the project's basedir or as an absolute path.<br/> | |||||
| <br/> | |||||
| <em>deprecated variation :</em> <br/> | |||||
| If the stylesheet cannot be found, and if you have specified the | |||||
| attribute basedir for the task, ant will assume that the style | |||||
| attribute is relative to the basedir of the task. | |||||
| </td> | </td> | ||||
| <td align="center" valign="top">Yes</td> | <td align="center" valign="top">Yes</td> | ||||
| </tr> | </tr> | ||||
| @@ -110,16 +110,20 @@ element which is used to perform Entity and URI resolution</p> | |||||
| <tr> | <tr> | ||||
| <td valign="top">processor</td> | <td valign="top">processor</td> | ||||
| <td valign="top">name of the XSLT processor to use. Permissible values are | |||||
| "trax" for a TraX compliant processor (ie JAXP interface | |||||
| implementation such as Xalan 2 or Saxon), | |||||
| "xslp" for the XSL:P processor, "xalan" for | |||||
| the Apache XML Xalan (version 1) processor the name of an | |||||
| arbitrary XSLTLiaison class. Defaults to trax, followed by xalan | |||||
| and then xslp (in that order). The first one found in your class | |||||
| <td valign="top">name of the XSLT processor to use. | |||||
| Permissible values are :<ul> | |||||
| <li>"trax" for a TraX compliant processor (ie JAXP interface | |||||
| implementation such as Xalan 2 or Saxon)</li> | |||||
| <li>"xalan" for | |||||
| the Apache XML Xalan (version 1) processor</li> | |||||
| <li>the name of a custom class implementing the interface | |||||
| <code>org.apache.tools.ant.taskdefs.XSLTLiaison.</code></li> | |||||
| </ul> | |||||
| Defaults to trax, followed by xalan | |||||
| The first one found in your class | |||||
| path is the one that is used. | path is the one that is used. | ||||
| <em><strong>DEPRECATED</strong> - XSL:P and xalan are deprecated and no | |||||
| <br/> | |||||
| <em><strong>DEPRECATED</strong> - xalan (xalan1) is deprecated and no | |||||
| more supported.</em>. | more supported.</em>. | ||||
| </td> | </td> | ||||
| <td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
| @@ -356,7 +356,7 @@ for examples on how to do this for your operating system. </p> | |||||
| <p><b>Note</b>: The bootstrap process of Ant requires a greedy | <p><b>Note</b>: The bootstrap process of Ant requires a greedy | ||||
| compiler like Sun's javac or jikes. It does not work with gcj or | compiler like Sun's javac or jikes. It does not work with gcj or | ||||
| kjc.</b> | |||||
| kjc.</p> | |||||
| <p>Make sure you have downloaded any auxiliary jars required to | <p>Make sure you have downloaded any auxiliary jars required to | ||||
| build tasks you are interested in. These should either be available | build tasks you are interested in. These should either be available | ||||
| @@ -433,7 +433,7 @@ Installing Ant / Optional Tasks</a> section above.</p> | |||||
| <td><b>Available At</b></td> | <td><b>Available At</b></td> | ||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td>An XSL transformer like Xalan or XSL:P</td> | |||||
| <td>An XSL transformer like Xalan</td> | |||||
| <td>style task</td> | <td>style task</td> | ||||
| <td> | <td> | ||||
| <b>If you use JDK 1.4+, an XSL transformer is already included, so you need not do anything special.</b><br> | <b>If you use JDK 1.4+, an XSL transformer is already included, so you need not do anything special.</b><br> | ||||
| @@ -564,7 +564,7 @@ you need jakarta-oro 2.0.1 or later, and <a href="#commons-net">commons-net</a>< | |||||
| target="_top">http://jakarta.apache.org/log4j/docs/index.html</a></td> | target="_top">http://jakarta.apache.org/log4j/docs/index.html</a></td> | ||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td><a name="commons-net">commons-net.jar</td> | |||||
| <td><a name="commons-net">commons-net.jar</a></td> | |||||
| <td>ftp, rexec and telnet tasks<br> | <td>ftp, rexec and telnet tasks<br> | ||||
| jakarta-oro 2.0.1 or later is required in any case together with commons-net.<br> | jakarta-oro 2.0.1 or later is required in any case together with commons-net.<br> | ||||
| For all users, a minimum version of commons-net of 1.4.0 is recommended. Earlier | For all users, a minimum version of commons-net of 1.4.0 is recommended. Earlier | ||||
| @@ -649,7 +649,8 @@ code will check and print the following things. </p> | |||||
| <ul> | <ul> | ||||
| <li>The version of ant.jar and ant-optional.jar -and that they match</li> | |||||
| <li>The version of ant.jar and of the ant-*.jar containing the optional tasks - | |||||
| and whether they match</li> | |||||
| <li>Which JAR files are int ANT_HOME/lib | <li>Which JAR files are int ANT_HOME/lib | ||||
| @@ -1,5 +1,5 @@ | |||||
| /* | /* | ||||
| * Copyright 2000-2005 The Apache Software Foundation | |||||
| * Copyright 2000-2006 The Apache Software Foundation | |||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| @@ -96,10 +96,6 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| private static final String TRAX_LIAISON_CLASS = | private static final String TRAX_LIAISON_CLASS = | ||||
| "org.apache.tools.ant.taskdefs.optional.TraXLiaison"; | "org.apache.tools.ant.taskdefs.optional.TraXLiaison"; | ||||
| /** Name of the now-deprecated XSLP Liaison class */ | |||||
| private static final String XSLP_LIAISON_CLASS = | |||||
| "org.apache.tools.ant.taskdefs.optional.XslpLiaison"; | |||||
| /** Name of the now-deprecated Xalan liaison class */ | /** Name of the now-deprecated Xalan liaison class */ | ||||
| private static final String XALAN_LIAISON_CLASS = | private static final String XALAN_LIAISON_CLASS = | ||||
| "org.apache.tools.ant.taskdefs.optional.XalanLiaison"; | "org.apache.tools.ant.taskdefs.optional.XalanLiaison"; | ||||
| @@ -169,11 +165,6 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| * @since Ant 1.7 | * @since Ant 1.7 | ||||
| */ | */ | ||||
| public static final String PROCESSOR_XALAN1 = "xalan"; | public static final String PROCESSOR_XALAN1 = "xalan"; | ||||
| /** | |||||
| * The xsl:p processor (deprecated option) | |||||
| * @since Ant 1.7 | |||||
| */ | |||||
| public static final String PROCESSOR_XSLP = "xslp"; | |||||
| /** | /** | ||||
| * Creates a new XSLTProcess Task. | * Creates a new XSLTProcess Task. | ||||
| @@ -430,8 +421,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| /** | /** | ||||
| * Set the name of the XSL processor to use; optional, default trax. | * Set the name of the XSL processor to use; optional, default trax. | ||||
| * Other values are "xalan" for Xalan1 and "xslp" for XSL:P, though the | |||||
| * later is strongly deprecated. | |||||
| * Other values are "xalan" for Xalan1 | |||||
| * | * | ||||
| * @param processor the name of the XSL processor | * @param processor the name of the XSL processor | ||||
| */ | */ | ||||
| @@ -472,10 +462,6 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| String classname; | String classname; | ||||
| if (proc.equals(PROCESSOR_TRAX)) { | if (proc.equals(PROCESSOR_TRAX)) { | ||||
| classname= TRAX_LIAISON_CLASS; | classname= TRAX_LIAISON_CLASS; | ||||
| } else if (proc.equals(PROCESSOR_XSLP)) { | |||||
| log("DEPRECATED - xslp processor is deprecated. Use trax " | |||||
| + "instead."); | |||||
| classname = XSLP_LIAISON_CLASS; | |||||
| } else if (proc.equals(PROCESSOR_XALAN1)) { | } else if (proc.equals(PROCESSOR_XALAN1)) { | ||||
| log("DEPRECATED - xalan processor is deprecated. Use trax " | log("DEPRECATED - xalan processor is deprecated. Use trax " | ||||
| + "instead."); | + "instead."); | ||||
| @@ -724,7 +710,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| */ | */ | ||||
| protected XSLTLiaison getLiaison() { | protected XSLTLiaison getLiaison() { | ||||
| // if processor wasn't specified, see if TraX is available. If not, | // if processor wasn't specified, see if TraX is available. If not, | ||||
| // default it to xslp or xalan, depending on which is in the classpath | |||||
| // default it to xalan, depending on which is in the classpath | |||||
| if (liaison == null) { | if (liaison == null) { | ||||
| if (processor != null) { | if (processor != null) { | ||||
| try { | try { | ||||
| @@ -739,13 +725,8 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { | |||||
| try { | try { | ||||
| resolveProcessor(PROCESSOR_XALAN1); | resolveProcessor(PROCESSOR_XALAN1); | ||||
| } catch (Throwable e2) { | } catch (Throwable e2) { | ||||
| try { | |||||
| resolveProcessor(PROCESSOR_XSLP); | |||||
| } catch (Throwable e3) { | |||||
| e3.printStackTrace(); | |||||
| e2.printStackTrace(); | |||||
| throw new BuildException(e1); | |||||
| } | |||||
| e2.printStackTrace(); | |||||
| throw new BuildException(e1); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,65 +0,0 @@ | |||||
| /* | |||||
| * Copyright 2000-2002,2004 The Apache Software Foundation | |||||
| * | |||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| * you may not use this file except in compliance with the License. | |||||
| * You may obtain a copy of the License at | |||||
| * | |||||
| * http://www.apache.org/licenses/LICENSE-2.0 | |||||
| * | |||||
| * Unless required by applicable law or agreed to in writing, software | |||||
| * distributed under the License is distributed on an "AS IS" BASIS, | |||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| * See the License for the specific language governing permissions and | |||||
| * limitations under the License. | |||||
| * | |||||
| */ | |||||
| package org.apache.tools.ant.taskdefs.optional; | |||||
| import com.kvisco.xsl.XSLProcessor; | |||||
| import com.kvisco.xsl.XSLReader; | |||||
| import com.kvisco.xsl.XSLStylesheet; | |||||
| import java.io.File; | |||||
| import java.io.FileOutputStream; | |||||
| import java.io.OutputStreamWriter; | |||||
| import org.apache.tools.ant.taskdefs.XSLTLiaison; | |||||
| /** | |||||
| * Concrete liaison for XSLP | |||||
| * | |||||
| * @since Ant 1.1 | |||||
| */ | |||||
| public class XslpLiaison implements XSLTLiaison { | |||||
| protected XSLProcessor processor; | |||||
| protected XSLStylesheet xslSheet; | |||||
| public XslpLiaison() { | |||||
| processor = new XSLProcessor(); | |||||
| // uh ?! I'm forced to do that otherwise a setProperty crashes | |||||
| // with NPE ! I don't understand why the property map is static | |||||
| // though... how can we do multithreading w/ multiple identical | |||||
| // parameters ? | |||||
| processor.getProperty("dummy-to-init-properties-map"); | |||||
| } | |||||
| public void setStylesheet(File fileName) throws Exception { | |||||
| XSLReader xslReader = new XSLReader(); | |||||
| // a file:/// + getAbsolutePath() does not work here | |||||
| // it is really the pathname | |||||
| xslSheet = xslReader.read(fileName.getAbsolutePath()); | |||||
| } | |||||
| public void transform(File infile, File outfile) throws Exception { | |||||
| FileOutputStream fos = new FileOutputStream(outfile); | |||||
| // XSLP does not support encoding...we're in hot water. | |||||
| OutputStreamWriter out = new OutputStreamWriter(fos, "UTF8"); | |||||
| processor.process(infile.getAbsolutePath(), xslSheet, out); | |||||
| } | |||||
| public void addParam(String name, String expression) { | |||||
| processor.setProperty(name, expression); | |||||
| } | |||||
| } //-- XSLPLiaison | |||||
| @@ -1,33 +0,0 @@ | |||||
| package org.apache.tools.ant.taskdefs.optional; | |||||
| import org.apache.tools.ant.taskdefs.XSLTLiaison; | |||||
| /* | |||||
| * Copyright 2001-2002,2004 The Apache Software Foundation | |||||
| * | |||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | |||||
| * you may not use this file except in compliance with the License. | |||||
| * You may obtain a copy of the License at | |||||
| * | |||||
| * http://www.apache.org/licenses/LICENSE-2.0 | |||||
| * | |||||
| * Unless required by applicable law or agreed to in writing, software | |||||
| * distributed under the License is distributed on an "AS IS" BASIS, | |||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||||
| * See the License for the specific language governing permissions and | |||||
| * limitations under the License. | |||||
| * | |||||
| */ | |||||
| /** | |||||
| * XSLP Liaison testcase | |||||
| */ | |||||
| public class XslpLiaisonTest extends AbstractXSLTLiaisonTest { | |||||
| public XslpLiaisonTest(String name){ | |||||
| super(name); | |||||
| } | |||||
| protected XSLTLiaison createLiaison() throws Exception { | |||||
| return new XslpLiaison(); | |||||
| } | |||||
| } | |||||