There's no way to define a useful and generic DTD, since the structure of the XML is
dependent on the SDT definition.
Cheers,
Philip
--On Tuesday, November 08, 2005 9:03 AM -1000 Hongbing Kou <[EMAIL PROTECTED]>
wrote:
Hi, folks,
How about define a generic DTD file for this kind of XML reports? Sensor
developer
can have the XSLT transformation to make them Hackystat compatible if they
don't.
Thanks,
Hongbing
At 12:22 AM 11/8/2005, Aaron Kagawa wrote:
Hey Guys,
As you probably know, lately I've implemented a bunch of sensors for tools
that generate XML reports; Emma, Checkstyle, PMD, FindBugs. And I've been
thinking that it was a pretty monotonous and boring task.
I've been also thinking about:
- a way to manually enter some data I have into Hackystat that I plan to
use (maybe just once).
- it would be cool to have a standard XML format for tools to send data to
Hackystat. For example, if Hackystat gets big enough, maybe Emma would
want to provide a XML file that can automatically be integrated with
Hackystat instead of relying on a specific sensor. Basically, cutting out
the "middle man".
- lastly, in my JPL work, we hacked a comma delimited sensor that
basically does the same thing. So, I figured if comma delimited works and
is useful, then XML should as well.
Anyway, the sensor is called hackySensor_XmlSensorData. Basically, it
sends Sensor Data to Hackystat from a file that is already in our
SensorData XML format. So, this sensor can even be used to transfer XML
Sensor Data to a new Hackystat server. This is an alternative to the Load
Sensor Data command, which doesn't work (i think).
Here is an example Ant target that shows how it could be used:
<!--
*********************************************************************** -->
<target name="xmlSensorData">
<taskdef name="hacky-xmlsensordata"
classname="org.hackystat.sensor.xmlsensordata.XmlSensorDataSensor"
classpath="${lib.dir}/ant/sensorshell.jar;${lib.dir}/ant/sensor.xmlsensordata.jar"
/>
<hacky-xmlsensordata verbose="true" tool="LOCC"
sensorDataType="FileMetric" useCurrentTimestamp="false">
<fileset dir="${build.dir}/fileMetric">
<include name="*.xml" />
</fileset>
</hacky-xmlsensordata>
</target>
Now, imagine that LOCC just executed and produced a XML Sensor Data
File. We could use the XmlSensorData sensor instead of a specialized LOCC
sensor. Or imagine that PMD created a special XML report, then we could
write a "translator" (with Jdom or even XSL) that creates the sensor data
XML file which will then be "sensed" with the XmlSensorData Sensor.
Anyway, I think this might be useful. But, I'm not sure if there are
issues with eSDT or any other that would make this a bad
idea. Comments/Questions welcome.
As always, since I did this on my own: Philip can I commit this to
Subversion? And commit my changes to modules.build.xml?
Here is one known issue:
http://hackydev.ics.hawaii.edu:8080/browse/HACK-400 , which shouldn't be
to hard to figure out.
thanks, aaron