I have a xml format data file, it contains information about tests, I want to get a good look view in browser, I want exact these information in different tables, all test info table, every module test info table, and test failed case table.
<testsuites tests="111" failures="3" disabled="0" errors="0" time="60.947" name="AllTests">
<testsuite name="ChdrvTestAout" tests="4" failures="0" disabled="0" errors="0" time="0">
</testsuite>
<testsuite name="ChdrvTestTuner" tests="28" failures="3" disabled="0" errors="0" time="60.944">
<testcase name="Case0001" status="run" time="0.001" classname="ChdrvTestTuner" />
<testcase name="Case0007" status="run" time="27.271" classname="ChdrvTestTuner">
<failure message="Value of: CHDRV_TEST_TUNER_0007()
 Actual: 0
Expected: (1)
Which is: 1" type=""><![CDATA[src/chdrv_tuner_test.cc:71
Value of: CHDRV_TEST_TUNER_0007()
Actual: 0
Expected: (1)
Which is: 1]]></failure>
</testcase>
</testsuite>
<testsuite name="FactorialTest" tests="3" failures="0" disabled="0" errors="0" time="0">
</testsuite>
<testsuite name="IsPrimeTest" tests="3" failures="0" disabled="0" errors="0" time="0">
</testsuite>
</testsuites>
I want to using XSLT format to HTML, to show data in multiple tables, I want to show this data in seperate module tables, like format:
-------------------------------------
module name | tests | failures
---------------------------------------
alltests | 111 | 3
--------------------------------------
-------------------------------------
module name | tests | failures
---------------------------------------
ChdrvTestAout| 4 | 0
--------------------------------------
-------------------------------------
module name | tests | failures
---------------------------------------
ChdrvTestTuner| 28 | 3
--------------------------------------
----------------------------------------------------------------------
casename | module | failed message
----------------------------------------------------------------------
case0007 | ChdrvTestTuner | src/chdrv_tuner_test.cc:71
----------------------------------------------------------------------
please see what I have tried here http://www.pastebin.ca/2414163, but it only show the "alltest" table of the first one above? how to write XSLT to do this? highly appreciate your help
Here is the "/" template of the XSLT:
<xsl:template match="/">
<html>
<body>
<h2 align="center">ChangHong driver test report!!!</h2>
<xsl:apply-templates select="testsuites"/>
<xsl:apply-templates select="testsuite"/>
<xsl:apply-templates select="testcase"/>
<xsl:apply-templates select="failure"/>
</body>
</html>
</xsl:template>
many thanks!!!
<xsl:apply-templates select="testsuites"/> <xsl:apply-templates select="testsuite"/> <xsl:apply-templates select="testcase"/> <xsl:apply-templates select="failure"/>it only show the first templates format. I don't know why it only show the first table about "alltest" above. do you want to see what I tried? but I don't know how to show you?