geirm 02/02/06 21:39:27
Modified: xdocs users-guide.xml
docs users-guide.html
Log:
Documenting (roughly) the recent additions to using DVSL via Ant
Revision Changes Path
1.3 +68 -2 jakarta-velocity-dvsl/xdocs/users-guide.xml
Index: users-guide.xml
===================================================================
RCS file: /home/cvs/jakarta-velocity-dvsl/xdocs/users-guide.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- users-guide.xml 11 Jan 2002 01:39:57 -0000 1.2
+++ users-guide.xml 7 Feb 2002 05:39:27 -0000 1.3
@@ -476,11 +476,21 @@
<td></td><td>$node.children()</td><td>Returns a List of all children of this
node</td>
</tr>
<tr>
- <td></td><td>$node.copy()</td><td>Does a 'deep copy' of this node's subtree to
the output</td>
+ <td></td>
+ <td>$node.copy()</td>
+ <td>Does a 'deep copy' of this node's subtree to the output</td>
</tr>
<tr>
- <td></td><td>$node.copy( List )</td><td>Does a 'deep copy' of the specified
nodelist to the output.</td>
+ <td></td>
+ <td>$node.copy( List )</td>
+ <td>Does a 'deep copy' of the specified nodelist to the output.</td>
</tr>
+ <tr>
+ <td></td>
+ <td>$node.valueOf( xpath )</td>
+ <td>Returns the result of the specified XPath as a Object</td>
+ </tr>
+
</table>
<p>
@@ -536,6 +546,62 @@
</tr>
</table>
+
+ </section>
+
+ <section name="Using DVSL via Ant">
+
+ <p>
+ Here are some important notes about using DVSL with Ant. These will be
+ revised into a more coherant section on using with Ant:
+ </p>
+
+ <strong>Configuring the Velocity Engine</strong>
+
+ <p>
+ It is now possible to configure the Velocity Engine when using DVSL
+ with Ant (and from your code, of course). This feature enables you to
+ set template paths, VelociMacro libraries, loggers, etc.
+ </p>
+
+ <p>
+ To use, you need to make a public class that implements
+ <code>java.util.Map</code>. Then place this class in the classpath, and
+ set the property 'velocityConfigClass'
+ to the name of your class :
+ </p>
+
+ <source><![CDATA[
+ <dvsl
+ basedir="${docs.src}"
+ destdir="${docs.dest}/"
+ extension=".html"
+ style="${docs.src}/site.dvsl"
+ excludes="**/project.xml"
+ toolbox="toolbox.props"
+ includes="**/*.xml"
+
+ velocityConfigClass="ConfigVel"
+
+ />
+
+ ]]></source>
+
+ <p>
+ Please see <code>examples/simple</code> for an example of this
+ technique.
+ </p>
+
+ <strong>Input and Output Filename</strong>
+ <p>
+ You can now access the name of the input file and the output file
+ inside the stylesheet. They can be accessed as
+ </p>
+ <source><![CDATA[
+ $inputfilename
+ $outputfilename
+ ]]>
+ </source>
</section>
1.3 +214 -37 jakarta-velocity-dvsl/docs/users-guide.html
Index: users-guide.html
===================================================================
RCS file: /home/cvs/jakarta-velocity-dvsl/docs/users-guide.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- users-guide.html 11 Jan 2002 01:39:57 -0000 1.2
+++ users-guide.html 7 Feb 2002 05:39:27 -0000 1.3
@@ -165,10 +165,11 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
$ cd jakarta-velocity-dvsl
$ ant jar
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -195,7 +196,7 @@
DVSL is able to be used without any programming.
</p>
<p>
- The first way is via commandline, where you can use it to transform a single
file, or as a filter.
+ The first way is via command line, where you can use it to transform a single
file, or as a filter.
The usage is :
</p>
<code>
@@ -227,11 +228,12 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
java org.apache.tools.dvsl.DVSL -STYLE src/stylesheets/site.dvsl -IN
xdocs/index.xml > out.stuff
java org.apache.tools.dvsl.DVSL -STYLE src/stylesheets/site.dvsl -OUT out.html <
xdocs/index.html
java org.apache.tools.dvsl.DVSL -STYLE src/stylesheets/site.dvsl <
xdocs/index.xml
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -272,6 +274,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
<target name="docs">
<taskdef name="dvsl"
classname="org.apache.tools.dvsl.DVSLTask">
@@ -291,8 +294,8 @@
includes="**/*.xml"
/>
</target>
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -353,6 +356,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
<?xml version="1.0"?>
@@ -368,8 +372,8 @@
</p>
</section>
</document>
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -410,6 +414,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
#match("document")
<html>
<body>
@@ -429,8 +434,8 @@
$node.copy( $node.children() )
</blockquote>
#end
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -471,6 +476,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
<html>
<body>
<hr>
@@ -491,8 +497,8 @@
</body>
</html>
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -542,12 +548,13 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
toolbox.contextname = toolbox
toolbox.tool.footool = Footool
toolbox.string.mystring = Hello there!
toolbox.integer.myint = 7
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -613,6 +620,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
<dvsl
basedir="${docs.src}"
destdir="${docs.dest}/"
@@ -622,8 +630,8 @@
toolbox="toolbox.props"
includes="**/*.xml
/>
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -664,6 +672,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
#match("document")
Hello from the document node.
@@ -678,8 +687,8 @@
Item $velocityCount : $data
#end
#end
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -720,6 +729,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
<?xml version="1.0"?>
<document value="5">
@@ -727,8 +737,8 @@
Data in &lt;document&gt; node
</document>
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -769,6 +779,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
import java.util.List;
public class Footool
@@ -789,8 +800,8 @@
return list;
}
}
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -831,6 +842,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
Hello from the document node.
From the toolbox :
@@ -842,8 +854,8 @@
Item 1 : red
Item 2 : blue
Item 3 : green
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -906,11 +918,12 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
#match( <XPath Expression > )
< template content >
#end
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -972,6 +985,7 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
<?xml version="1.0"?>
<document>
<section name="first">
@@ -983,8 +997,8 @@
</p>
</section>
</document>
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -1034,9 +1048,10 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
$node.section.children()
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -1322,6 +1337,30 @@
</td>
</tr>
+<tr>
+
+
+<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+
+ </font>
+</td>
+
+
+<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ $node.valueOf( xpath )
+ </font>
+</td>
+
+
+<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ Returns the result of the specified XPath as a Object
+ </font>
+</td>
+
+</tr>
</table>
<p>
@@ -1352,9 +1391,10 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
$attrib.name
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -1562,6 +1602,141 @@
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
+ <a name="Using DVSL via Ant">
+ <strong>Using DVSL via Ant</strong></a></font>
+ </td></tr>
+
+ <tr><td><blockquote>
+ <p>
+ Here are some important notes about using DVSL with Ant. These will be
+ revised into a more coherant section on using with Ant:
+ </p>
+<strong>Configuring the Velocity Engine</strong>
+<p>
+ It is now possible to configure the Velocity Engine when using DVSL
+ with Ant (and from your code, of course). This feature enables you to
+ set template paths, VelociMacro libraries, loggers, etc.
+ </p>
+<p>
+ To use, you need to make a public class that implements
+ <code>java.util.Map</code>. Then place this class in the classpath, and
+ set the property 'velocityConfigClass'
+ to the name of your class :
+ </p>
+
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#023264" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#023264" width="1" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#ffffff" height="1">
+ <pre>
+
+ <dvsl
+ basedir="${docs.src}"
+ destdir="${docs.dest}/"
+ extension=".html"
+ style="${docs.src}/site.dvsl"
+ excludes="**/project.xml"
+ toolbox="toolbox.props"
+ includes="**/*.xml"
+
+ velocityConfigClass="ConfigVel"
+
+ />
+
+
+ </pre></td>
+ <td bgcolor="#023264" width="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#023264" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#023264" width="1" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ </tr>
+ </table>
+ </div>
+<p>
+ Please see <code>examples/simple</code> for an example of this
+ technique.
+ </p>
+<strong>Input and Output Filename</strong>
+<p>
+ You can now access the name of the input file and the output file
+ inside the stylesheet. They can be accessed as
+ </p>
+
+ <div align="left">
+ <table cellspacing="4" cellpadding="0" border="0">
+ <tr>
+ <td bgcolor="#023264" width="1" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#023264" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#023264" width="1" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#ffffff" height="1">
+ <pre>
+
+ $inputfilename
+ $outputfilename
+
+
+ </pre></td>
+ <td bgcolor="#023264" width="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ </tr>
+ <tr>
+ <td bgcolor="#023264" width="1" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#023264" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ <td bgcolor="#023264" width="1" height="1">
+ <img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ </blockquote></td></tr>
+
+ </table>
+
+ <table border="0" cellspacing="0" cellpadding="2" width="100%">
+
+ <tr><td bgcolor="#525D76">
+ <font color="#ffffff" face="arial,helvetica.sanserif">
<a name="Default Template Rules">
<strong>Default Template Rules</strong></a></font>
</td></tr>
@@ -1594,11 +1769,12 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
#match( "/" )$context.applyTemplates()#end
#match("*")$context.applyTemplates()#end
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -1652,11 +1828,12 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
+
#match("text()")$node.value()#end
#match("@*")$node.value()#end
-</pre>
- </td>
+
+ </pre></td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>