jon 01/04/30 09:11:29
Modified: docs anakia.html
xdocs anakia.xml
Log:
added some documentation thanks to a posting on the list by geir.
Revision Changes Path
1.19 +26 -0 jakarta-velocity/docs/anakia.html
Index: anakia.html
===================================================================
RCS file: /home/cvs/jakarta-velocity/docs/anakia.html,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- anakia.html 2001/03/27 00:39:15 1.18
+++ anakia.html 2001/04/30 16:11:25 1.19
@@ -116,6 +116,32 @@
files.
</p>
<p>
+ The basic model that AnakiaTask uses is pretty straightforward :
+ <ol>
+ <li>Parse your XML into a JDOM Document:<br />
+<pre>SAXBuilder builder;
+Document root = null;
+
+try
+{
+ builder = new SAXBuilder(
+ "org.apache.xerces.parsers.SAXParser" );
+ root = builder.build( file );
+}
+catch( Exception )
+{
+ System.out.println( ... );
+}</pre></li>
+
+ <li>Stuff the Document (or root Element) into the context:<br />
+<pre>context.put("root", root );</pre></li>
+
+ <li>Render a template using Velocity. Within the template, one
+ can use JDOM's methods to access the data contained in the
+ XML document.</li>
+ </ol>
+</p>
+ <p>
Anakia is potentially easier to learn than XSL, but it maintains a
similar level of functionality. Learning cryptic <xsl:> tags
is unnecessary; you only need to know how to use the provided
1.10 +27 -0 jakarta-velocity/xdocs/anakia.xml
Index: anakia.xml
===================================================================
RCS file: /home/cvs/jakarta-velocity/xdocs/anakia.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- anakia.xml 2001/03/15 02:44:11 1.9
+++ anakia.xml 2001/04/30 16:11:27 1.10
@@ -20,6 +20,33 @@
files.
</p>
<p>
+ The basic model that AnakiaTask uses is pretty straightforward :
+ <ol>
+ <li>Parse your XML into a JDOM Document:<br/>
+<pre>SAXBuilder builder;
+Document root = null;
+
+try
+{
+ builder = new SAXBuilder(
+ "org.apache.xerces.parsers.SAXParser" );
+ root = builder.build( file );
+}
+catch( Exception )
+{
+ System.out.println( ... );
+}</pre></li>
+
+ <li>Stuff the Document (or root Element) into the context:<br/>
+<pre>context.put("root", root );</pre></li>
+
+ <li>Render a template using Velocity. Within the template, one
+ can use JDOM's methods to access the data contained in the
+ XML document.</li>
+ </ol>
+</p>
+
+<p>
Anakia is potentially easier to learn than XSL, but it maintains a
similar level of functionality. Learning cryptic <xsl:> tags
is unnecessary; you only need to know how to use the provided