geirm 02/02/06 21:40:30
Modified: src/java/org/apache/tools/dvsl DVSLTask.java
Log:
Added the insertion of a user context - and in that put the current
input filename and output filename so it can be accessed from within
the stylesheet when rendering
Revision Changes Path
1.3 +12 -0
jakarta-velocity-dvsl/src/java/org/apache/tools/dvsl/DVSLTask.java
Index: DVSLTask.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity-dvsl/src/java/org/apache/tools/dvsl/DVSLTask.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DVSLTask.java 6 Feb 2002 04:47:12 -0000 1.2
+++ DVSLTask.java 7 Feb 2002 05:40:30 -0000 1.3
@@ -257,6 +257,18 @@
writer = new BufferedWriter( new FileWriter( outfile ) );
/*
+ * add a user context so we can store the current input
+ * and output filename, which must be interesting to know
+ */
+
+ VelocityContext userContext = new VelocityContext();
+
+ userContext.put("inputfilename", infilename);
+ userContext.put("outputfilename", outfilename);
+
+ dvsl.setUserContext( userContext );
+
+ /*
* do the transformation
*/
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>