Wednesday, December 20, 2006

ant-contrib 1.0b3 is out!

ant-contrib 1.0b3, a broadly used helper library for Ant, was released in October. This release adds some new tasks. Check out their read-me for more.

Ant 1.7 is out!

The folks over at Apache have released Ant 1.7. It's the first major release in almost 18 months. Head on over to http://ant.apache.org to check it out.

Wednesday, December 06, 2006

The wonders of XSLT 2.0

In our current Ant build setup, we parse a lot of the source analysis xml reports to gather figures on code bugs,coverage, etc and compile them into a single report. This is currently achieved by means of a combination of grep,gawk,sed, and the math function of the ant-contrib library. It's cross-platform and it's horrendously messy.
Enter XSLT 2.0
I had dabbled with XSLT 1.0 to tweak our PMD reports to show violations other than priorities 1-5, and had only just managed to gain enough knowledge to do that and only that.
However, I thought I could improve upon the standard HTML PMD report template, so I recently bought Michael Kays XSLT 2.0 and XPath 2.0 books. Both serve as excellent reference material to the two language standards.
Working with XSLT, you need a good XSLT 2.0 debugger/editor, so I purchased a copy of Syncrosoft's oXygen 8.0 XML Editor. This has excellent support for XSLT debugging, and is compliant with latest XSLT 2.0 standard (June 2006), which is achieved through its use of Michael Kays (author of the books) Saxon XSLT/XPath library.
Saxon is also available as a free download from http://saxon.sourceforge.net

I'm now beginning a project to remove all of the sed/awk/grep nonsense from the ant-script and replace it with some tidy XSLT.
If you have to pull data from xml reports for code stats, and aren't using XSLT, then you should check it out. Those of you using XSLT 1.0 to generate HTML reports from xml data would do well to see what benefits you could achieve by moving to XSLT 2.0 + XPath 2.0

I'll post a link to a sample PMD report generated with XSLT 2.0 from PMD XML data sometime soon.