this sounds great, thanks heaps. I would like to include your files in
our contrib section, but I have a few questions before I do it:
* Correctness: When you transform file names to package names, do
you take platform specific file separators into accound ('/' on
Unix, "\" on windows)?
* Error handling: I see you check for ":" characters to determine
catch absolute path names early. Could you add a check for
file.startsWith("/") so it works on Unix, too?
* Usability: As far as I know, none of the current checkstyle
developers is too familiar with xsl. Could you please provide the
integration file you were talking about, so users don't have to
call the style task more than once?
* Usability: Is it possible to delete the dummy.html from within
xsl, or to chose a filename that will be overwritten by the next
step in the pipeline? Would it be easier for the user to have only
one xsl file?
* Feature request (low priority): Is it possible to provide a
basedir parameter to the stylesheet, so the stylesheet strips a
prefix from filename before determining the package name?
That was a long list, but don't let that scare you off, these are all
just minor points.
Again, thanks for your contribution,
Richard Atkins wrote:
>I've put together a set of stylesheets that I thought you might find useful.
>They generate a report that looks more like Javadoc than the current
>checkstyle-frame.xsl. It works by automagically determining the package name
>from the given files. Unlike the old xsl, it requires that the files be
>relative, otherwise it would treat drive letters, etc as package names!
>It also takes into account the new severity level, and generates a number of
>summary reports for your pleasure.
>Attached are the (many) files that make up the transform - at this point I
>use Ant to join the pipeline together, but this could easily be done by a
>wrapper xsl that goes and calls the others in turn.
>checkstyle-package.xsl - converts each file element in the original report
>file into package elements containing file elements.
>checkstyle-package-merge.xsl - does the same as file-merge, only for
>checkstyle-frames2.xsl - takes a checkstyle2 report (as generated by
>checkstyle-package), and calls the css, filelist, index, overview and
>checkstyle-frames2-css.xsl - generates the stylesheet (much the same as in
>the old xsl).
>"-"-filelist.xsl - generates the pages shown in the lower left frame.
>"-"-index.xsl - generates the frameset page.
>"-"-overview.xsl - generates the main page on the right, and
>"-"-packagelist.xsl - generates the pages shown in the top right frame.
>These use the Apache license (as they are based on the great work done in
>the old xsl file), so are free for your use.
>Also attached is a build.xml showing how to use these stylesheets, along
>with how the other stylesheets are used (for comparison).
>Please let me know if there are any problems, and I'll see what I can do.