geirm 01/12/18 12:44:56
Added: docs index.html license.html more-resources.html
users-guide.html
Log:
initial doc checkin
Revision Changes Path
1.1 jakarta-velocity-dvsl/docs/index.html
Index: index.html
===================================================================
<html>
<head>
<title>DVSL - DVSL</title>
<meta name="author" value="Geir Magnusson Jr."/>
<meta name="email" value="[EMAIL PROTECTED]" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">
<table border="0" width="100%" cellspacing="4">
<tr><td colspan="2">
<a href="http://jakarta.apache.org/">
<img src="http://jakarta.apache.org/images/jakarta-logo.gif"
align="left" alt="The Jakarta Project" border="0"/>
</a>
<a href="$home">
<img src="/images/logo.gif" align="right" alt=" < :) />" border="0"/>
</a>
</td></tr>
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<tr>
<td width="20%" valign="top" nowrap="true">
<p>
<strong>Velocity</strong>
</p>
<ul>
<li><a href="http://jakarta.apache.org/velocity/">Velocity Home</a></li>
</ul>
<p>
<strong>About</strong>
</p>
<ul>
<li><a href="./index.html">DVSL Home</a></li>
<li><a href="./users-guide.html#Getting Started : Building and
Using">Getting Started</a></li>
<li><a href="./license.html">License</a></li>
</ul>
<p>
<strong>Documentation</strong>
</p>
<ul>
<li><a href="./users-guide.html">Users Guide</a></li>
<li><a href="./more-resources.html">More Resources</a></li>
</ul>
<p>
<strong>Community</strong>
</p>
<ul>
<li><a href="http://jakarta.apache.org/site/getinvolved.html">Get
Involved</a></li>
<li><a href="http://jakarta.apache.org/site/cvsindex.html">CVS
Repository</a></li>
<li><a href="http://jakarta.apache.org/site/mail.html">Mailing
List</a></li>
</ul>
</td>
<!-- RIGHT SIDE MAIN BODY -->
<td width="80%" valign="top" align="left">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="DVSL : Declarative XML Processing without the Tears">
<strong>DVSL : Declarative XML Processing without the
Tears</strong></a></font>
</td></tr>
<tr><td><blockquote>
<p>
DVSL (Declarative Velocity Style Language) is a tool modeled after
XSLT and is intended for general XML transformations. The key
differences are that it
incorporates easy access to Java objects and allows you to use
the Velocity template language and it's features for expresing the
transformation templates.
</p>
<strong> Similarities to XSLT</strong>
<p>
DVSL steals two of the best features of XSLT:
</p>
<ul>
<li>
It uses a declarative syntax like XSLT.
</li>
<li>
Document control and selection is based on XPath.
</li>
</ul>
<strong>Differences From XSLT</strong>
<p>
DVSL differs from XSLT in a few ways
</p>
<ul>
<li>
DVSL's template language is Velocity, so conventional Velocity syntax is
used to get and set data, to perform looping and flow control, etc. All
features of VTL are available.
</li>
<li>
Because DVSL is based on Velocity, it offers a very tight binding to
Java objects. This means that it's easy to access other data sources
from within the DVSL stylesheet, using conventional method call syntax,
allowing you to integrate, collect, and
transform with and to outside data like databases, calculation libraries, etc
</li>
<li>
DVSL also allows the creation of 'dynamic stylesheets' -
ones whose matching rules can be altered
as a group. (see examples)
</li>
</ul>
</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="Current Status">
<strong>Current Status</strong></a></font>
</td></tr>
<tr><td><blockquote>
<p>
The current status is best described as 'post experiemental', where the
basic test of styling it's own documentation (this that you are
now reading)
without resorting to ugly hacks and kludges
has been passed.
</p>
<p>
The code is still very primitive (and downright embarassing in places...),
and the object model (from the template POV) is still crystalizing, and
no performance work has been done.
</p>
</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="Nightly Snapshots">
<strong>Nightly Snapshots</strong></a></font>
</td></tr>
<tr><td><blockquote>
<p>
Nightly snapshots of CVS will soon be available.
</p>
</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="CVS Access">
<strong>CVS Access</strong></a></font>
</td></tr>
<tr><td><blockquote>
<p>
Access to the DVSL CVS repository is available :
</p>
<ul>
<li><a href="http://cvs.apache.org/viewcvs/jakarta-velocity-dvsl/">Online</a>
via ViewCVS in your browser.
</li>
<li>
Using a <a href="http://jakarta.apache.org/getinvolved/cvsindex.html">cvs
client</a>
</li>
</ul>
</blockquote></td></tr>
</table>
</td>
</tr>
<!-- FOOTER SEPARATOR -->
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<!-- PAGE FOOTER -->
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1"><em>
Copyright © 1999-2001, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
</body>
</html>
1.1 jakarta-velocity-dvsl/docs/license.html
Index: license.html
===================================================================
<html>
<head>
<title>DVSL - Apache Software License</title>
<meta name="author" value="
Velocity Documentation Team"/>
<meta name="email" value="[EMAIL PROTECTED]" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">
<table border="0" width="100%" cellspacing="4">
<tr><td colspan="2">
<a href="http://jakarta.apache.org/">
<img src="http://jakarta.apache.org/images/jakarta-logo.gif"
align="left" alt="The Jakarta Project" border="0"/>
</a>
<a href="$home">
<img src="/images/logo.gif" align="right" alt=" < :) />" border="0"/>
</a>
</td></tr>
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<tr>
<td width="20%" valign="top" nowrap="true">
<p>
<strong>Velocity</strong>
</p>
<ul>
<li><a href="http://jakarta.apache.org/velocity/">Velocity Home</a></li>
</ul>
<p>
<strong>About</strong>
</p>
<ul>
<li><a href="./index.html">DVSL Home</a></li>
<li><a href="./users-guide.html#Getting Started : Building and
Using">Getting Started</a></li>
<li><a href="./license.html">License</a></li>
</ul>
<p>
<strong>Documentation</strong>
</p>
<ul>
<li><a href="./users-guide.html">Users Guide</a></li>
<li><a href="./more-resources.html">More Resources</a></li>
</ul>
<p>
<strong>Community</strong>
</p>
<ul>
<li><a href="http://jakarta.apache.org/site/getinvolved.html">Get
Involved</a></li>
<li><a href="http://jakarta.apache.org/site/cvsindex.html">CVS
Repository</a></li>
<li><a href="http://jakarta.apache.org/site/mail.html">Mailing
List</a></li>
</ul>
</td>
<!-- RIGHT SIDE MAIN BODY -->
<td width="80%" valign="top" align="left">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="Apache Software License">
<strong>Apache Software License</strong></a></font>
</td></tr>
<tr><td><blockquote>
<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>
/*
* ====================================================================
*
* 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 acknowledgement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
*
* 4. The names "The Jakarta Project", "Velocity",
"DVSL" 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",
* "Velocity" 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/>.
*
*/
</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>
</td>
</tr>
<!-- FOOTER SEPARATOR -->
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<!-- PAGE FOOTER -->
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1"><em>
Copyright © 1999-2001, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
</body>
</html>
1.1 jakarta-velocity-dvsl/docs/more-resources.html
Index: more-resources.html
===================================================================
<html>
<head>
<title>DVSL - Apache Software License</title>
<meta name="author" value="
DVSL Documentation Team"/>
<meta name="email" value="[EMAIL PROTECTED]" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">
<table border="0" width="100%" cellspacing="4">
<tr><td colspan="2">
<a href="http://jakarta.apache.org/">
<img src="http://jakarta.apache.org/images/jakarta-logo.gif"
align="left" alt="The Jakarta Project" border="0"/>
</a>
<a href="$home">
<img src="/images/logo.gif" align="right" alt=" < :) />" border="0"/>
</a>
</td></tr>
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<tr>
<td width="20%" valign="top" nowrap="true">
<p>
<strong>Velocity</strong>
</p>
<ul>
<li><a href="http://jakarta.apache.org/velocity/">Velocity Home</a></li>
</ul>
<p>
<strong>About</strong>
</p>
<ul>
<li><a href="./index.html">DVSL Home</a></li>
<li><a href="./users-guide.html#Getting Started : Building and
Using">Getting Started</a></li>
<li><a href="./license.html">License</a></li>
</ul>
<p>
<strong>Documentation</strong>
</p>
<ul>
<li><a href="./users-guide.html">Users Guide</a></li>
<li><a href="./more-resources.html">More Resources</a></li>
</ul>
<p>
<strong>Community</strong>
</p>
<ul>
<li><a href="http://jakarta.apache.org/site/getinvolved.html">Get
Involved</a></li>
<li><a href="http://jakarta.apache.org/site/cvsindex.html">CVS
Repository</a></li>
<li><a href="http://jakarta.apache.org/site/mail.html">Mailing
List</a></li>
</ul>
</td>
<!-- RIGHT SIDE MAIN BODY -->
<td width="80%" valign="top" align="left">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="More Information">
<strong>More Information</strong></a></font>
</td></tr>
<tr><td><blockquote>
<p>
For a good basic tutorial on XPAth, see
<a href="http://www.zvon.org/xxl/XPathTutorial/General/examples.html">
this site</a> at <a href="http://www.zevon.org">Zevon.org</a>
</p>
</blockquote></td></tr>
</table>
</td>
</tr>
<!-- FOOTER SEPARATOR -->
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<!-- PAGE FOOTER -->
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1"><em>
Copyright © 1999-2001, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
</body>
</html>
1.1 jakarta-velocity-dvsl/docs/users-guide.html
Index: users-guide.html
===================================================================
<html>
<head>
<title>DVSL - DVSL User Guide</title>
<meta name="author" value="Geir Magnusson Jr."/>
<meta name="email" value="[EMAIL PROTECTED]" />
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76"
alink="#525D76" vlink="#525D76">
<table border="0" width="100%" cellspacing="4">
<tr><td colspan="2">
<a href="http://jakarta.apache.org/">
<img src="http://jakarta.apache.org/images/jakarta-logo.gif"
align="left" alt="The Jakarta Project" border="0"/>
</a>
<a href="$home">
<img src="/images/logo.gif" align="right" alt=" < :) />" border="0"/>
</a>
</td></tr>
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<tr>
<td width="20%" valign="top" nowrap="true">
<p>
<strong>Velocity</strong>
</p>
<ul>
<li><a href="http://jakarta.apache.org/velocity/">Velocity Home</a></li>
</ul>
<p>
<strong>About</strong>
</p>
<ul>
<li><a href="./index.html">DVSL Home</a></li>
<li><a href="./users-guide.html#Getting Started : Building and
Using">Getting Started</a></li>
<li><a href="./license.html">License</a></li>
</ul>
<p>
<strong>Documentation</strong>
</p>
<ul>
<li><a href="./users-guide.html">Users Guide</a></li>
<li><a href="./more-resources.html">More Resources</a></li>
</ul>
<p>
<strong>Community</strong>
</p>
<ul>
<li><a href="http://jakarta.apache.org/site/getinvolved.html">Get
Involved</a></li>
<li><a href="http://jakarta.apache.org/site/cvsindex.html">CVS
Repository</a></li>
<li><a href="http://jakarta.apache.org/site/mail.html">Mailing
List</a></li>
</ul>
</td>
<!-- RIGHT SIDE MAIN BODY -->
<td width="80%" valign="top" align="left">
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif">
<a name="DVSL Users Guide">
<strong>DVSL Users Guide</strong></a></font>
</td></tr>
<tr><td><blockquote>
<p>
DVSL (Declarative Velocity Style Language) is a tool modeled after
XSLT and is intended for general XML transformations.
DVSL steals two of the best features of XSLT:
</p>
<ul>
<li>
It uses a declarative syntax like XSLT.
</li>
<li>
Document control and selection is based on XPath.
</li>
</ul>
<p>
DVSL's template language is <a href="http://jakarta.apache.org/velocity/">
Velocity</a>, so conventional Velocity syntax is
used to get and set data, to perform looping and flow control, etc.
Anything that you can normally do in a Velocity template can be done
in DVSL templates.
</p>
</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="Getting Started : Building and Using">
<strong>Getting Started : Building and Using</strong></a></font>
</td></tr>
<tr><td><blockquote>
<strong>Where to Get DVSL</strong>
<p>
Before you use DVSL, you must get the source and build the tool.
Currently, there is no release, so you must either get a
nightly snapshot, or download directly from CVS.
</p>
<strong>How to Build</strong>
<p>
Building DVSL is very simple. All dependency jars that are required
are included in the distribution. However, we do require that
<a href="http://jakarta.apache.org/ant/">Jakarta Ant</a> is installed.
</p>
<p>
Once ant is installed, you simply need to change to the project
root directory and invoke ant with the 'jar' target :
</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>
$ cd jakarta-velocity-dvsl
$ ant jar
</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>
This will build the dvsl jar in the project root directory.
</p>
<strong>Using DVSL</strong>
<p>
While DVSL is also a tool that can be integrated into your applications,
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 usage is :
</p>
<code>
java org.apache.tools.dvsl.DVSL -STYLE <i>stylesheet</i> [-IN <i>infile</i>]
[-OUT <i>outfile</i> ]
</code>
<p>
Note that the stylesheet is the only required element, and the input and output
then default to
<code>stdin</code> and <code>stdout</code>.
By adding the appropriate stuff in your classpath (that would be all the jars in
the project
<code>lib</code> directory ), you can use it :
</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>
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>
<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>
You can also use DVSL right from ant using the included Ant task. The Ant task
supports the toolbox.
</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>
<target name="docs">
<taskdef name="dvsl"
classname="org.apache.tools.dvsl.DVSLTask">
<classpath>
<pathelement
location="${project.name}-${project.version}.jar"/>
<path refid="classpath"/>
</classpath>
</taskdef>
<dvsl
basedir="${docs.src}"
destdir="${docs.dest}/"
toolbox="${docs.src}/toolbox.props"
extension=".html"
style="${source.home}/stylesheets/site.dvsl"
excludes="**/project.xml"
includes="**/*.xml"
/>
</target>
</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="Starting with Examples">
<strong>Starting with Examples</strong></a></font>
</td></tr>
<tr><td><blockquote>
<p>
A few examples are provided with the current distribution, in the
<code>examples</code>
directory in the distribution, and the examples that follow were originally taken
from there.
</p>
<strong>Simmple Example</strong>
<p>
To begin, we will start with a simple example. Here is a basic XML document
</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>
<?xml version="1.0"?>
<document>
<section name="foo">
<p>
Hello from section foo
</p>
</section>
<section name="bar">
<p>
Hello from section bar
</p>
</section>
</document>
</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>
A simple DVSL stylesheet to transform this into HTML might look like :
</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>
#match("document")
<html>
<body>
$context.applyTemplates()
</body>
</html>
#end
#match("section")
<hr>
<b>Section:</b> $attrib.name
$context.applyTemplates("p")
#end
#match("p")
<blockquote>
$node.copy( $node.children() )
</blockquote>
#end
</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>
With the resulting output of
</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>
<html>
<body>
<hr>
<b>Section:</b> foo
<blockquote>
Hello from section foo
</blockquote>
<hr>
<b>Section:</b> bar
<blockquote>
Hello from section bar
</blockquote>
</body>
</html>
</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>
This can be found in examples/simple and is example1.xml and example1.dvsl.
</p>
<strong>Now Add Some External Tools</strong>
<p>
A more interesting example involves specifying and using tools. We'll give an
example and explain the toolbox later on.
</p>
<p>
A simple toolbox example is included, in examples/toolbox. First, you must
define the tools and values in a properties file
</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>
toolbox.contextname = toolbox
toolbox.tool.footool = Footool
toolbox.string.mystring = Hello there!
toolbox.integer.myint = 7
</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>
Here we do a couple of things :
</p>
<ol>
<li>
<code>toolbox.contextname = toolbox</code> :
defines 'toolbox' as the name we will use in the template
to access the tools.
</li>
<li>
<code>toolbox.tool.footool = Footool</code> : defines that an instance
of the class 'Footool' will be placed in the context under the key 'footool'.
</li>
<li>
<code>toolbox.string.mystring = Hello there!</code> : defines that a
<code>java.lang.String</code>
"Hello there!" will be placed in the context under the key 'mystring'
</li>
<li>
<code>toolbox.integer.myint = 7</code> : defines that a
<code>java.lang.Integer</code> will be placed in the context under the
key 'myint'.
</li>
</ol>
<p>
You specify the toolbox in the <dvsl> task in the ant script as
such :
</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"
/>
</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>
To use the tools, this is the stylesheet that has an example :
</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>
#match("document")
Hello from the document node.
From the toolbox :
Method : $context.toolbox.footool.getFoo()
String : $context.toolbox.mystring
Int : $context.toolbox.myint
#foreach( $data in $context.toolbox.footool.getList() )
Item $velocityCount : $data
#end
#end
</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>
With an input of :
</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>
<?xml version="1.0"?>
<document value="5">
Data in &lt;document&gt; node
</document>
</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>
And with the class Footool
</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>
import java.util.List;
public class Footool
{
public String getFoo()
{
return "Hello from Foo!";
}
public List getList()
{
List list = new java.util.ArrayList();
list.add( "red" );
list.add( "blue" );
list.add( "green" );
return list;
}
}
</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>
You get the output
</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>
Hello from the document node.
From the toolbox :
Method : Hello from Foo!
String : Hello there!
Int : 7
Item 1 : red
Item 2 : blue
Item 3 : green
</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>
This can be found in <code>examples/toolbox</code>.
</p>
<p>
Also, the <code>examples/velocitydocs</code> example shows how to grab
and use the HTMLEscape class from the Velocity jar as a tool to do
escaping.
</p>
</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="The 'Template API'">
<strong>The 'Template API'</strong></a></font>
</td></tr>
<tr><td><blockquote>
<p>
Writing templates is very simple. The basic template definition uses the directive
</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>
#match( <XPath Expression > )
< template content >
#end
</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>
This directive declares that when a node matches the <code><XPath Expression
></code>
then the body of the directive is to be rendered to the ouput.
In the body, you would place any static content you wish to go to
the output, and also get data from the XML document you are working in.
</p>
<p>
<i>Future plans include a #name() directive, and optional arguments to the #match()
and #name() directives to support modes and namsepaces.</i>
</p>
<strong>The Node API</strong>
<p>
During processing, when a match occurs and a template is invoked, a few objects
are placed in the
Context for you to access. These elements are read-only and cannot be modified
via #set().
</p>
<p>
The most important is the current Node, which is accessible via the reference
<code>$node</code>. The <code>$node</code> is the current node that matched
the template XPath expression (or name).
</p>
<p>
You can use the $node object two ways. First, you can use the Velocity property
formalism to access
child nodes in the document tree rooted at the current node. So with a document
such 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>
<?xml version="1.0"?>
<document>
<section name="first">
<p>
<code>foo</code>
</p>
<p>
<code>bar</code>
</p>
</section>
</document>
</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>
you could use references like
</p>
<pre>
$node.section.p.code
</pre>
<p>
to access elements and atributes in the subtree,
assuming that $node was the 'document' element.
Further, you can of course call methods on the
sub-elements :
</p>
<pre>
$node.section.children()
</pre>
<p>As for methods, <code>$node</code> has the following API
for you to use :
</p>
<table>
<tr>
<td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Reference
</font>
</td>
<td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Methods
</font>
</td>
<td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
$node
</font>
</td>
<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">
Current node for this template match.
</font>
</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.name()
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Element name of node - ex 'table'
</font>
</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.value()
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Text content of node
</font>
</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.attrib("name")
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Returns attribute of node if appropriate.
</font>
</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.selectNodes( xpath )
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Returns an iteratable list of nodes that satisfy the XPath expression
</font>
</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.selectSingleNode( xpath )
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Returns the first node that satisfies the XPath expression
</font>
</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.get( xpath )
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Returns the first node that satisfies the XPath expression
</font>
</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.children()
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Returns a List of all children of this node
</font>
</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.copy()
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Does a 'deep copy' of this node's subtree to the output
</font>
</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.copy( List )
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Does a 'deep copy' of the specified nodelist to the output.
</font>
</td>
</tr>
</table>
<p>
The next node-specific reference is <code>$attrib</code>. This
corresponds to a collection of the current nodes attributes (if appropriate - for
example, an attribute doesn't itself have attributes) which you can use
to quickly get the values using Velocity's property reference formalism.
So with the example above, if you matched the 'section' node
you could find the value of the 'name' attribute via
</p>
<pre>
$attrib.name
</pre>
<p>
Which would return 'first'.
</p>
<p>
The final reference available is <code>$context</code>. This object offers the
following API :
</p>
<table>
<tr>
<td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Reference
</font>
</td>
<td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Methods
</font>
</td>
<td bgcolor="#039acc" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Description
</font>
</td>
</tr>
<tr>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
$context
</font>
</td>
<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">
Utility context.
</font>
</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">
$context.applyTemplates()
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Applies all templates in the subtree against the ruleset.
</font>
</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">
$context.applyTemplates( XPath )
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Applies templates to all nodes in the subtree
that match the given XPath expression. Ex. <code> $context.applyTemplates(
"*|@*" ) </code>
</font>
</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">
$context.applyTemplates( Node )
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Applies templates to the specified node. First match is applied.
</font>
</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">
$context.applyTemplates( Node, XPath )
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Applies the XPath expression to the specified node, and applies
templates to the resulting nodeset.
</font>
</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">
$context.applyTemplates( Node, XPath )
</font>
</td>
<td bgcolor="#a0ddf0" colspan="" rowspan="" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">
Applies the XPath expression to the specified node, and applies
templates to the resulting nodeset.
</font>
</td>
</tr>
</table>
</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>
<tr><td><blockquote>
<p>
DVSL has default patterns to drive the transformation engine just like
XSLT does. These patterns currently are modeled after the XSLT default
behavior. DVLS differs in that it will offer you the abillity to
override the default patterns w/o having to change your stylesheet.
The patterns are :
</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>
#match( "/" )$context.applyTemplates()#end
#match("*")$context.applyTemplates()#end
</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>
These patterns are registered in the matching engine first, so any
patterns specified in the stylesheet will override these definitions.
</p>
<p>
What this means for the user is that DVSL will automatically start with
the root of the document (in the XSL sense, the the 'properly formed
document sense') and try to match each element that it finds.
Because it has a default rule for elements ("*") it will appply templates
to all nodes in each element that it finds. Further it will print out the
value of each text ndoes, and each attribute node.
</p>
<p>
These rules are copied from the XSLT spec. There are two more rules
that have been commented out :
</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>
#match("text()")$node.value()#end
#match("@*")$node.value()#end
</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>
which should be there for XSLT spec compliance. If you want them, just
uncomment in <code>org.apache.tools.dvsl.resource.defaultroot.dvsl</code>
and rebuild the jar.
</p>
<p>
They are currently left out as they don't seem to be desireable, and it
doesn't appear that xalan respects the rules either.
</p>
</blockquote></td></tr>
</table>
</td>
</tr>
<!-- FOOTER SEPARATOR -->
<tr>
<td colspan="2">
<hr noshade="" size="1"/>
</td>
</tr>
<!-- PAGE FOOTER -->
<tr><td colspan="2">
<div align="center"><font color="#525D76" size="-1"><em>
Copyright © 1999-2001, Apache Software Foundation
</em></font></div>
</td></tr>
</table>
</body>
</html>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>