Advertisment

New Testertool – Anakia

Anakia is  an XML transformation tool,  that uses JDOM and Velocity to transform XML documents into the format of your choice.

It provides an alternative to using Ant’s task and XSL to process XML files.

The basic model that AnakiaTask uses is pretty straightforward :

  1. Parse your XML into a JDOM Document:
    SAXBuilder builder;
    Document root = null;
    
    try
    {
        builder = new SAXBuilder(
            "org.apache.xerces.parsers.SAXParser" );
        root = builder.build( file );
    }
    catch( Exception )
    {
        System.out.println( ...  );
    }
  2. Stuff the Document (or root Element) into the context:
    context.put("root", root );
  3. Render a template using Velocity. Within the template, one can use JDOM’s methods to access the data contained in the XML document.

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 Context objects, JDOM, and Velocity’s simple directives.

Anakia seems to perform much faster than Xalan’s XSL processor at creating pages. (23 pages are generated in 7-8 seconds on a PIII 500mhz running Win98 and JDK 1.3 with client Hotspot. A similar system using Ant’s <style> task took 14-15 seconds — nearly a 2x speed improvement.)

Anakia — intended to replace Stylebook, which was originally used to generate simple, static web sites in which all pages had the same look and feel — is great for documentation/project web sites, such as the sites on www.apache.org and jakarta.apache.org. As it is more targeted to a specific purpose, it does not provide some of XSL’s “extra” functionality.

The example in the jakarta-velocity/examples/anakia directory provides a good introduction to Anakia. You should find it quite simple to use.

Anakia creates a Context, which contains a JDOM Document object of the .xml page, as well as an (optional) JDOM Document object of your project.xml page. The .vsl page is executed (using Velocity) with the Context. You can then navigate your .xml file and pull information out of it by simply executing methods on the JDOM Document object.

Anakia is being used to create the documentation for not only this website, but also for the Jakarta Project’s website as well as many of the projects that live under the Jakarta Project. This process is documented on the site.

For more details visit here

Share and Enjoy:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • BlinkList
  • LinkedIn
  • Netvibes
  • NewsVine
  • Turn this article into a PDF!
  • StumbleUpon
  • Yahoo! Buzz

Did you enjoy this post?

If so, would you please consider sharing it with the world

Leave a Reply




Advertisment
My Twitter Friends
Friends: 939 Followers: 394
New Testertool – CodeNarc

1

Comments

Add

New Testertool – CodeNarc

The CodeNarc project provides a static analysis tool and framework for analyzing Groovy source code.
CodeNarc scans Groovy source code, looking for violations of predefined or custom rules and generates an HTML or XML report of the results. These rules include checks for coding standards, or searching for unused code,

New Testertool – Macker

0

Comments

Add

New Testertool – Macker

Macker is a build-time architectural rule checking utility for Java developers.
View the rules file

It’s meant to model the architectural ideals programmers always dream up for their projects, and then break — it helps keep code clean and consistent. Users can tailor a rules file to suit a specific project’s structure, or write some

New Testertool – Anakia

0

Comments

Add

New Testertool – Anakia

Anakia is  an XML transformation tool,  that uses JDOM and Velocity to transform XML documents into the format of your choice.
It provides an alternative to using Ant’s task and XSL to process XML files.
The basic model that AnakiaTask uses is pretty straightforward :

Parse your XML into a JDOM Document:
SAXBuilder builder;
Document root =

New TesterTools – Andariel Ant Tasks

0

Comments

Add

New TesterTools – Andariel Ant Tasks

Andariel is a set of tasks designed to help the generation of HTML (and other markup languages) pages from Ant. Includes a XPath processor, an image information retriever, and others.
Tasks
Current tasks include:

XPath: This is used to perform an XPath query on an XML file. It’s designed to be used together with Ant

Tags: , ,