it should be reasonable easy to create additional reports to be run.
the basic idea is that reports implement IElementVisitor. all reports
are called in sequence for each element. the output writer should be
injected (preferrably during construction but definitely before the
report is run). all the reports ATM use an IXmlWriter implementation
but it should be possible to mix in reports that wrap the raw Writer as
well.
So, for example, given elements Alpha and Beta and reports X and Y (in
that order), X will visit Alpha then Y will visit Alpha followed by X
visiting Beta and Y visitiing Beta during the reporting traversal which
builds up the report.
so, if X on Alpha produces:
<x-factor rating='8'/>
and on Beta produces:
<x-factory rating='0'/>
and Y on Alpha produces:
<why>'Cos It's Cool</why>
and Y on Beta produces:
<why>Seemed Like A Good Idea At The Time</why>
then by writing when called during the traversal will produce something
like:
<standard name='Alpha'>...
<x-factor rating='8'/>
<why>'Cos It's Cool</why>
</standard>
<standard name='Beta'>
<x-factory rating='0'/>
<why>Seemed Like A Good Idea At The Time</why>
</standard>
it sounds long to explain but i hpoe that it'll be intuitive and quick
in practice: just create an IElementVisitor implementation (perhaps
extending ElementVisitorImpl or AbstractXmlReportVisitor). often, the
will be an adapter (possibly with some filtering).
i'll probably create a stylesheet which create a plain text report from
the xml to avoid duplicate maintenance.
anyone who wants to create stylesheets to create fancy html from the
xml is very welcome. no, there isn;t a DTD or schema (seems a little
early in the process to fix the format). html with links to the actual
contents would be useful indeed.
- robert