jon 02/01/10 17:39:57
Modified: docs license.html users-guide.html
src/stylesheets site.dvsl
xdocs users-guide.xml
Log:
cleaned up some of the formatting so that the boxes look cleaner.
fixed a couple spelling typos
-jon
Revision Changes Path
1.2 +2 -3 jakarta-velocity-dvsl/docs/license.html
Index: license.html
===================================================================
RCS file: /home/cvs/jakarta-velocity-dvsl/docs/license.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- license.html 18 Dec 2001 20:44:56 -0000 1.1
+++ license.html 11 Jan 2002 01:39:57 -0000 1.2
@@ -116,7 +116,6 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
/*
* ====================================================================
*
@@ -173,8 +172,8 @@
* <http://www.apache.org/>.
*
*/
-
- </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>
1.2 +236 -193 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- users-guide.html 18 Dec 2001 20:44:56 -0000 1.1
+++ users-guide.html 11 Jan 2002 01:39:57 -0000 1.2
@@ -165,11 +165,10 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
- $ cd jakarta-velocity-dvsl
- $ ant jar
-
- </pre></td>
+$ 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>
@@ -228,14 +227,11 @@
</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>
+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>
@@ -276,31 +272,27 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
-
+<target name="docs">
- <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>
+ <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>
@@ -337,9 +329,9 @@
directory in the distribution, and the examples that follow were originally
taken
from there.
</p>
-<strong>Simmple Example</strong>
+<strong>Simple Example</strong>
<p>
- To begin, we will start with a simple example. Here is a basic XML document
+ To begin, we will start with a simple example. Here is a basic XML document:
</p>
<div align="left">
@@ -361,25 +353,23 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
-
- <?xml version="1.0"?>
+<?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>
+<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>
@@ -420,29 +410,27 @@
</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>
+#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>
@@ -483,31 +471,28 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
+<html>
+ <body>
+ <hr>
+ <b>Section:</b> foo
+ <blockquote>
- <html>
- <body>
- <hr>
- <b>Section:</b> foo
- <blockquote>
+ Hello from section foo
- Hello from section foo
+ </blockquote>
- </blockquote>
+ <hr>
+ <b>Section:</b> bar
+ <blockquote>
- <hr>
- <b>Section:</b> bar
- <blockquote>
+ Hello from section bar
- Hello from section bar
+ </blockquote>
- </blockquote>
-
- </body>
- </html>
-
-
- </pre></td>
+ </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>
@@ -557,13 +542,12 @@
</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>
+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>
@@ -629,19 +613,17 @@
</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>
+<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>
@@ -682,24 +664,22 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
- #match("document")
+#match("document")
- Hello from the document node.
+ Hello from the document node.
- From the toolbox :
+ From the toolbox :
- Method : $context.toolbox.footool.getFoo()
- String : $context.toolbox.mystring
- Int : $context.toolbox.myint
+ Method : $context.toolbox.footool.getFoo()
+ String : $context.toolbox.mystring
+ Int : $context.toolbox.myint
- #foreach( $data in $context.toolbox.footool.getList() )
- Item $velocityCount : $data
- #end
+ #foreach( $data in $context.toolbox.footool.getList() )
+ Item $velocityCount : $data
#end
-
-
- </pre></td>
+#end
+</pre>
+ </td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -740,16 +720,15 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
- <?xml version="1.0"?>
+<?xml version="1.0"?>
- <document value="5">
+<document value="5">
- Data in &lt;document&gt; node
+ Data in &lt;document&gt; node
- </document>
-
- </pre></td>
+</document>
+</pre>
+ </td>
<td bgcolor="#023264" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
@@ -790,7 +769,6 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
import java.util.List;
public class Footool
@@ -811,9 +789,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>
@@ -854,22 +831,19 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
-
- Hello from the document node.
-
- From the toolbox :
+Hello from the document node.
- Method : Hello from Foo!
- String : Hello there!
- Int : 7
-
- Item 1 : red
- Item 2 : blue
- Item 3 : green
+From the toolbox :
-
- </pre></td>
+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>
@@ -932,12 +906,11 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
- #match( <XPath Expression > )
- < template content >
- #end
-
- </pre></td>
+#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>
@@ -999,20 +972,19 @@
</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>
+<?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>
@@ -1042,9 +1014,46 @@
Further, you can of course call methods on the
sub-elements :
</p>
-<pre>
- $node.section.children()
- </pre>
+
+ <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>
+$node.section.children()
+</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>As for methods, <code>$node</code> has the following API
for you to use :
</p>
@@ -1323,9 +1332,46 @@
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>
+
+ <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>
+$attrib.name
+</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 would return 'first'.
</p>
@@ -1548,13 +1594,11 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
- #match( "/" )$context.applyTemplates()#end
+#match( "/" )$context.applyTemplates()#end
- #match("*")$context.applyTemplates()#end
-
-
- </pre></td>
+#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>
@@ -1608,12 +1652,11 @@
</td>
<td bgcolor="#ffffff" height="1">
<pre>
-
- #match("text()")$node.value()#end
+#match("text()")$node.value()#end
- #match("@*")$node.value()#end
-
- </pre></td>
+#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>
1.2 +2 -3 jakarta-velocity-dvsl/src/stylesheets/site.dvsl
Index: site.dvsl
===================================================================
RCS file: /home/cvs/jakarta-velocity-dvsl/src/stylesheets/site.dvsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- site.dvsl 18 Dec 2001 21:02:44 -0000 1.1
+++ site.dvsl 11 Jan 2002 01:39:57 -0000 1.2
@@ -179,9 +179,8 @@
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
<td bgcolor="#ffffff" height="1">
- <pre>
- $toolbox.htmlescape.getText( $node.value() )
- </pre></td>
+ <pre>$toolbox.htmlescape.getText( $node.value() )</pre>
+ </td>
<td bgcolor="$source-color" width="1">
<img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0"
border="0"/>
</td>
1.2 +165 -180 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- users-guide.xml 18 Dec 2001 20:43:48 -0000 1.1
+++ users-guide.xml 11 Jan 2002 01:39:57 -0000 1.2
@@ -59,10 +59,10 @@
root directory and invoke ant with the 'jar' target :
</p>
- <source>
- $ cd jakarta-velocity-dvsl
- $ ant jar
- </source>
+<source>
+$ cd jakarta-velocity-dvsl
+$ ant jar
+</source>
<p>
This will build the dvsl jar in the project root directory.
@@ -76,7 +76,7 @@
</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>
@@ -91,41 +91,37 @@
<code>lib</code> directory ), you can use it :
</p>
- <source>
- <![CDATA[
- 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
- ]]>
- </source>
+<source><![CDATA[
+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
+]]></source>
<p>
You can also use DVSL right from ant using the included Ant task. The Ant task
supports the toolbox.
</p>
- <source>
- <![CDATA[
- <target name="docs">
+<source><![CDATA[
+<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>
- ]]>
- </source>
+ <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>
+]]></source>
</section>
@@ -137,86 +133,82 @@
from there.
</p>
- <strong>Simmple Example</strong>
+ <strong>Simple Example</strong>
<p>
- To begin, we will start with a simple example. Here is a basic XML document
+ To begin, we will start with a simple example. Here is a basic XML document:
</p>
- <source>
- <![CDATA[
-
- <?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>
- ]]></source>
+<source>
+<![CDATA[
+<?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>
+]]></source>
<p>
A simple DVSL stylesheet to transform this into HTML might look like :
</p>
- <source><![CDATA[
-
- #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
- ]]></source>
+<source><![CDATA[
+#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
+]]></source>
<p>
With the resulting output of
</p>
- <source><![CDATA[
+<source><![CDATA[
+<html>
+ <body>
+ <hr>
+ <b>Section:</b> foo
+ <blockquote>
- <html>
- <body>
- <hr>
- <b>Section:</b> foo
- <blockquote>
+ Hello from section foo
- Hello from section foo
+ </blockquote>
- </blockquote>
+ <hr>
+ <b>Section:</b> bar
+ <blockquote>
- <hr>
- <b>Section:</b> bar
- <blockquote>
+ Hello from section bar
- Hello from section bar
+ </blockquote>
- </blockquote>
-
- </body>
- </html>
-
- ]]></source>
+ </body>
+</html>
+]]></source>
<p>
This can be found in examples/simple and is example1.xml and example1.dvsl.
@@ -234,12 +226,12 @@
define the tools and values in a properties file
</p>
- <source>
- toolbox.contextname = toolbox
- toolbox.tool.footool = Footool
- toolbox.string.mystring = Hello there!
- toolbox.integer.myint = 7
- </source>
+<source>
+toolbox.contextname = toolbox
+toolbox.tool.footool = Footool
+toolbox.string.mystring = Hello there!
+toolbox.integer.myint = 7
+</source>
<p>
Here we do a couple of things :
@@ -272,60 +264,58 @@
such :
</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"
- />
-
- ]]></source>
+<source><![CDATA[
+<dvsl
+ basedir="${docs.src}"
+ destdir="${docs.dest}/"
+ extension=".html"
+ style="${docs.src}/site.dvsl"
+ excludes="**/project.xml"
+ toolbox="toolbox.props"
+ includes="**/*.xml
+/>
+]]></source>
<p>
To use the tools, this is the stylesheet that has an example :
</p>
- <source><![CDATA[
- #match("document")
+<source><![CDATA[
+#match("document")
- Hello from the document node.
+ Hello from the document node.
- From the toolbox :
+ From the toolbox :
- Method : $context.toolbox.footool.getFoo()
- String : $context.toolbox.mystring
- Int : $context.toolbox.myint
+ Method : $context.toolbox.footool.getFoo()
+ String : $context.toolbox.mystring
+ Int : $context.toolbox.myint
- #foreach( $data in $context.toolbox.footool.getList() )
- Item $velocityCount : $data
- #end
+ #foreach( $data in $context.toolbox.footool.getList() )
+ Item $velocityCount : $data
#end
-
- ]]></source>
+#end
+]]></source>
<p>
With an input of :
</p>
- <source><![CDATA[
- <?xml version="1.0"?>
+<source><![CDATA[
+<?xml version="1.0"?>
- <document value="5">
+<document value="5">
- Data in <document> node
+ Data in <document> node
- </document>
- ]]></source>
+</document>
+]]></source>
<p>
And with the class Footool
</p>
- <source><![CDATA[
+<source><![CDATA[
import java.util.List;
public class Footool
@@ -346,28 +336,25 @@
return list;
}
}
-
- ]]></source>
+]]></source>
<p>
You get the output
</p>
- <source><![CDATA[
-
- Hello from the document node.
+<source><![CDATA[
+Hello from the document node.
- From the toolbox :
+From the toolbox :
- Method : Hello from Foo!
- String : Hello there!
- Int : 7
-
- Item 1 : red
- Item 2 : blue
- Item 3 : green
-
- ]]></source>
+Method : Hello from Foo!
+String : Hello there!
+Int : 7
+
+ Item 1 : red
+ Item 2 : blue
+ Item 3 : green
+]]></source>
<p>
This can be found in <code>examples/toolbox</code>.
@@ -387,11 +374,11 @@
Writing templates is very simple. The basic template definition uses the
directive
</p>
- <source>
- #match( <XPath Expression > )
- < template content >
- #end
- </source>
+<source>
+#match( <XPath Expression > )
+ < template content >
+#end
+</source>
<p>
This directive declares that when a node matches the <code><XPath Expression
></code>
@@ -423,19 +410,19 @@
child nodes in the document tree rooted at the current node. So with a document
such as :
</p>
- <source><![CDATA[
- <?xml version="1.0"?>
- <document>
- <section name="first">
- <p>
- <code>foo</code>
- </p>
- <p>
- <code>bar</code>
- </p>
- </section>
- </document>
- ]]></source>
+<source><![CDATA[
+<?xml version="1.0"?>
+<document>
+ <section name="first">
+ <p>
+ <code>foo</code>
+ </p>
+ <p>
+ <code>bar</code>
+ </p>
+ </section>
+</document>
+]]></source>
<p>
you could use references like
@@ -452,9 +439,9 @@
sub-elements :
</p>
- <pre>
- $node.section.children()
- </pre>
+<source>
+$node.section.children()
+</source>
<p>As for methods, <code>$node</code> has the following API
for you to use :
@@ -505,9 +492,9 @@
you could find the value of the 'name' attribute via
</p>
- <pre>
- $attrib.name
- </pre>
+<source>
+$attrib.name
+</source>
<p>
Which would return 'first'.
@@ -562,12 +549,11 @@
The patterns are :
</p>
- <source><![CDATA[
- #match( "/" )$context.applyTemplates()#end
-
- #match("*")$context.applyTemplates()#end
+<source><![CDATA[
+#match( "/" )$context.applyTemplates()#end
- ]]></source>
+#match("*")$context.applyTemplates()#end
+]]></source>
<p>
These patterns are registered in the matching engine first, so any
@@ -588,11 +574,11 @@
that have been commented out :
</p>
- <source><![CDATA[
- #match("text()")$node.value()#end
+<source><![CDATA[
+#match("text()")$node.value()#end
- #match("@*")$node.value()#end
- ]]></source>
+#match("@*")$node.value()#end
+]]></source>
<p>
which should be there for XSLT spec compliance. If you want them, just
@@ -609,4 +595,3 @@
</body>
</document>
-
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>