bodewig 01/10/29 03:16:49
Modified: . build.xml
docs/manual install.html
docs/manual/CoreTasks style.html
src/main/org/apache/tools/ant/taskdefs XSLTProcess.java
Added: src/main/org/apache/tools/ant/taskdefs/optional
AdaptxLiaison.java
src/testcases/org/apache/tools/ant/taskdefs/optional
AdaptxLiaisonTest.java
Log:
Make <style> support Exolab's new Adaptx processor.
Submitted by: Arnaud Blandin <[EMAIL PROTECTED]>
Revision Changes Path
1.190 +15 -0 jakarta-ant/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-ant/build.xml,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -r1.189 -r1.190
--- build.xml 2001/10/26 09:36:40 1.189
+++ build.xml 2001/10/29 11:16:49 1.190
@@ -166,6 +166,13 @@
<available property="servlet.present"
classname="javax.servlet.Servlet"
classpathref="classpath"/>
+
+ <available property="adaptx.present"
+ classname="org.exolab.adaptx.xslt.XSLTProcessor"
+ classpathref="classpath" />
+ <available property="xerces.present"
+ classname="org.apache.xerces.parsers.SAXParser"
+ classpathref="classpath" />
<condition property="javamail.complete">
<and>
@@ -236,6 +243,7 @@
<exclude name="${optional.package}/NetRexxC.java"
unless="netrexx.present" />
<exclude name="${optional.package}/XslpLiaison.java"
unless="xslp.present" />
<exclude name="${optional.package}/XalanLiaison.java"
unless="xalan.present" />
+ <exclude name="${optional.package}/AdaptxLiaison.java"
unless="adaptx.present" />
<exclude name="${optional.package}/ejb/Ejbc*.java"
unless="ejb.ejbc.present" />
<exclude name="${optional.package}/ejb/DDCreator*.java"
unless="ejb.DDCreator.present" />
<exclude name="${optional.package}/ejb/WLRun.java"
unless="ejb.wls.present" />
@@ -663,6 +671,8 @@
unless="xslp.present"/>
<exclude
name="org/apache/tools/ant/taskdefs/optional/XalanLiaisonTest.java"
unless="xalan.present"/>
+ <exclude
name="org/apache/tools/ant/taskdefs/optional/AdaptxLiaisonTest.java"
+ unless="adaptx.present"/>
</javac>
</target>
@@ -744,6 +754,11 @@
<exclude
name="org/apache/tools/ant/taskdefs/optional/AbstractXSLTLiaisonTest.java" />
<exclude
name="org/apache/tools/ant/taskdefs/optional/XslpLiaisonTest.java"
unless="xslp.present"/>
<exclude
name="org/apache/tools/ant/taskdefs/optional/XalanLiaisonTest.java"
unless="xalan.present"/>
+
+ <exclude
name="org/apache/tools/ant/taskdefs/optional/AdaptxLiaisonTest.java"
+ unless="adaptx.present"/>
+ <exclude
name="org/apache/tools/ant/taskdefs/optional/AdaptxLiaisonTest.java"
+ unless="xerces.present"/>
<!-- ehm, this is not really a TraX test but rather a xalan2
test..-->
<exclude
name="org/apache/tools/ant/taskdefs/optional/TraXLiaisonTest.java"
unless="xalan2.present"/>
1.16 +6 -4 jakarta-ant/docs/manual/install.html
Index: install.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/install.html,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- install.html 2001/10/11 13:44:42 1.15
+++ install.html 2001/10/29 11:16:49 1.16
@@ -249,11 +249,13 @@
<td><b>Available At</b></td>
</tr>
<tr>
- <td>An XSL transformer like Xalan or XSL:P</td>
+ <td>An XSL transformer like Xalan, Adaptx or XSL:P</td>
<td>style task</td>
<td><a href="http://xml.apache.org/xalan-j/index.html"
- target="_top">http://xml.apache.org/xalan-j/index.html</a> or <a
- href="http://www.clc-marketing.com/xslp/"
+ target="_top">http://xml.apache.org/xalan-j/index.html</a>,
+ CVS module adaptx from :pserver:[EMAIL PROTECTED]:/cvs/adaptx
+ with password anoncvs
+ or <a href="http://www.clc-marketing.com/xslp/"
target="_top">http://www.clc-marketing.com/xslp/</a></td>
</tr>
<tr>
@@ -262,7 +264,7 @@
<td><a href="http://jakarta.apache.org/regexp/"
target="_top">jakarta.apache.org/regexp/</a></td>
</tr>
<tr>
- <td>jakarta-oro-2.0.1.jar</td>
+ <td>jakarta-oro-2.0.4.jar</td>
<td>regexp type with mappers and the perforce tasks</td>
<td><a href="http://jakarta.apache.org/oro/"
target="_top">jakarta.apache.org/oro/</a></td>
</tr>
1.10 +8 -5 jakarta-ant/docs/manual/CoreTasks/style.html
Index: style.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/style.html,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- style.html 2001/08/30 13:23:13 1.9
+++ style.html 2001/10/29 11:16:49 1.10
@@ -87,11 +87,14 @@
<td valign="top">name of the XSLT processor to use. Permissible values
are
"trax" for a TraX compliant processor, "xslp" for
the
XSL:P processor, "xalan" for the Apache XML Xalan (version
1)
- processor, or the name of an arbitrary XSLTLiaison class. Defaults to
trax,
- followed by xslp then xalan (in that order). The first one found in
your
- class path is the one that is used.
- <em><strong>DEPRECATED</strong> - XSL:P is deprecated and will be
removed
- in the next version. Use trax or xalan instead.</em>.
+ processor, "adaptx" for the Exolab Adaptx processor
+ or the name of an arbitrary XSLTLiaison class. Defaults to trax,
+ followed by xalan, then adaptx and then xslp (in that
+ order). The first one found in your class path is the one that
+ is used.
+ <em><strong>DEPRECATED</strong> - XSL:P and Adaptx are
+ deprecated and will be removed in the next version. Use trax or
+ xalan instead.</em>.
</td>
<td align="center" valign="top">No</td>
</tr>
1.27 +15 -5
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
Index: XSLTProcess.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- XSLTProcess.java 2001/10/28 21:26:29 1.26
+++ XSLTProcess.java 2001/10/29 11:16:49 1.27
@@ -278,6 +278,11 @@
final Class clazz =
loadClass("org.apache.tools.ant.taskdefs.optional.XalanLiaison");
liaison = (XSLTLiaison)clazz.newInstance();
+ } else if (proc.equals("adaptx")) {
+ log("DEPRECATED - adaptx processor is deprecated. Use trax or
xalan instead.");
+ final Class clazz =
+
loadClass("org.apache.tools.ant.taskdefs.optional.AdaptxLiaison");
+ liaison = (XSLTLiaison) clazz.newInstance();
} else {
liaison = (XSLTLiaison) loadClass(proc).newInstance();
}
@@ -402,14 +407,19 @@
resolveProcessor("trax");
} catch (Throwable e1) {
try {
- resolveProcessor("xslp");
+ resolveProcessor("xalan");
} catch (Throwable e2) {
try {
- resolveProcessor("xalan");
+ resolveProcessor("adaptx");
} catch (Throwable e3) {
- e3.printStackTrace();
- e2.printStackTrace();
- throw new BuildException(e1);
+ try {
+ resolveProcessor("xslp");
+ } catch (Throwable e4) {
+ e4.printStackTrace();
+ e3.printStackTrace();
+ e2.printStackTrace();
+ throw new BuildException(e1);
+ }
}
}
}
1.1
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/AdaptxLiaison.java
Index: AdaptxLiaison.java
===================================================================
/*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Ant", 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 names without prior written
* permission of the Apache Group.
*
* 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. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.tools.ant.taskdefs.optional;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import org.apache.tools.ant.taskdefs.XSLTLiaison;
import org.exolab.adaptx.xslt.XSLTProcessor;
import org.exolab.adaptx.xslt.XSLTReader;
import org.exolab.adaptx.xslt.XSLTStylesheet;
/**
*
* @author <a href="mailto:[EMAIL PROTECTED]">Arnaud Blandin</a>
* @version $Revision: 1.1 $ $Date: 2001/10/29 11:16:49 $
*/
public class AdaptxLiaison implements XSLTLiaison {
protected XSLTProcessor processor;
protected XSLTStylesheet xslSheet;
public AdaptxLiaison () {
processor = new XSLTProcessor();
}
public void setStylesheet(File fileName) throws Exception {
XSLTReader xslReader = new XSLTReader();
xslSheet = xslReader.read( fileName.getAbsolutePath() );
};
public void transform(File infile, File outfile) throws Exception {
FileOutputStream fos = new FileOutputStream(outfile);
OutputStreamWriter out = new OutputStreamWriter(fos,"UTF8");
processor.process(infile.getAbsolutePath(), xslSheet, out);
}
public void addParam(String name, String expression){
processor.setProperty(name, expression);
}
} //-- AdaptxLiaison
1.1
jakarta-ant/src/testcases/org/apache/tools/ant/taskdefs/optional/AdaptxLiaisonTest.java
Index: AdaptxLiaisonTest.java
===================================================================
/*
* 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 acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Jakarta-Regexp", 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 names without prior written
* permission of the Apache Group.
*
* 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. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.tools.ant.taskdefs.optional;
import org.apache.tools.ant.taskdefs.XSLTLiaison;
/**
* Adaptx Liaison testcase
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
*/
public class AdaptxLiaisonTest extends AbstractXSLTLiaisonTest {
public AdaptxLiaisonTest(String name){
super(name);
}
protected XSLTLiaison createLiaison() throws Exception {
return new AdaptxLiaison();
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>