Author: mbenson
Date: Wed Nov 23 10:14:04 2005
New Revision: 348509

URL: http://svn.apache.org/viewcvs?rev=348509&view=rev
Log:
add filenamemapper support to <xslt>.
Bugzilla 37604. Submitted by Maarten Coene.

Modified:
    ant/core/trunk/CONTRIBUTORS
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/etc/testcases/taskdefs/style/build.xml
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
    ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java

Modified: ant/core/trunk/CONTRIBUTORS
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/CONTRIBUTORS?rev=348509&r1=348508&r2=348509&view=diff
==============================================================================
Binary files - no diff available.

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/WHATSNEW?rev=348509&r1=348508&r2=348509&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Wed Nov 23 10:14:04 2005
@@ -309,7 +309,10 @@
 
 * New task <makeurl> that can turn a file reference into an absolute file://
   url; and nested filesets/paths into a (space, comma, whatever) separated
-  list of URLs. Useful for RMI classpath setup, amongst other things. 
+  list of URLs. Useful for RMI classpath setup, amongst other things.
+
+* <xslt> now accepts nested FileNameMappers e.g. <globmapper>.
+  Bugzilla report 37604.
 
 
 Changes from Ant 1.6.4 to Ant 1.6.5

Modified: ant/core/trunk/src/etc/testcases/taskdefs/style/build.xml
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/etc/testcases/taskdefs/style/build.xml?rev=348509&r1=348508&r2=348509&view=diff
==============================================================================
--- ant/core/trunk/src/etc/testcases/taskdefs/style/build.xml (original)
+++ ant/core/trunk/src/etc/testcases/taskdefs/style/build.xml Wed Nov 23 
10:14:04 2005
@@ -57,6 +57,14 @@
     </xslt>
   </target>
 
+  <target name="testTypedMapper">
+    <property name="value" value="myvalue"/>
+    <xslt style="printParams.xsl" destDir="${out.dir}" basedir=".">
+      <param name="set" expression="${value}"/>
+      <globmapper from="data.*" to="out.*"/>
+    </xslt>
+  </target>
+
   <target name="testExplicitFileset">
     <property name="value" value="myvalue"/>
     <xslt style="printParams.xsl" destDir="${out.dir}"
@@ -99,4 +107,4 @@
       </copy>
   </target>
 
-</project>
\ No newline at end of file
+</project>

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java?rev=348509&r1=348508&r2=348509&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java 
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java Wed 
Nov 23 10:14:04 2005
@@ -214,6 +214,18 @@
     }
 
     /**
+     * Adds a nested filenamemapper.
+     * @param fileNameMapper the mapper to add
+     * @exception BuildException if more than one mapper is defined
+     * @since Ant 1.7.0
+     */
+    public void add(FileNameMapper fileNameMapper) throws BuildException {
+       Mapper mapper = new Mapper(getProject());
+       mapper.add(fileNameMapper);
+       addMapper(mapper);
+    }
+    
+    /**
      * Executes the task.
      *
      * @exception BuildException if there is an execution problem.

Modified: 
ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java
URL: 
http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java?rev=348509&r1=348508&r2=348509&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java 
(original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/taskdefs/StyleTest.java 
Wed Nov 23 10:14:04 2005
@@ -105,6 +105,13 @@
                            "set='myvalue'");
     }
 
+    public void testTypedMapper() throws Exception {
+        assertTrue(!getProject().resolveFile("out/out.xml").exists());
+        expectFileContains("testTypedMapper",
+                           "out/out.xml",
+                           "set='myvalue'");
+    }
+
     public void testDirectoryHierarchyWithDirMatching() throws Exception {
         executeTarget("testDirectoryHierarchyWithDirMatching");
         assertTrue(getProject().resolveFile("out/dest/level1/data.html")



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to