test_report.xsl

00001 <?xml version="1.0"?>
00002 <xsl:stylesheet version="1.0"
00003   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
00004   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
00005   xmlns="http://www.w3.org/1999/xhtml"
00006   xmlns:str="http://exslt.org/strings"
00007 >
00008   <xsl:output 
00009     method="xml"
00010     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
00011     doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
00012     indent="yes"
00013   />
00014     <xsl:template match="/test">
00015       <xsl:variable name="test_id" select="@id" />
00016       <xsl:document 
00017         href="test_{$test_id}.html"
00018         method="xml"
00019         doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
00020         doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
00021         indent="yes"
00022       >
00023 
00024 <html>
00025   <head>
00026     <title>
00027       ::<xsl:value-of select="@id" /> @ <xsl:value-of select="host" />::
00028     </title>
00029     <link rel="stylesheet" type="text/css" href="test_report.css" />
00030   </head>
00031 <body>
00032 
00033 <table>
00034 <!-- the unit test row -->
00035   <tr class="heading">
00036     <td>
00037       <!-- test id -->
00038       <xsl:value-of select="@id" />
00039       <br />
00040       <xsl:value-of select="host" />
00041     </td>
00042   </tr>
00043   <tr>
00044     <td>
00045     <div class="syn">
00046       <table class="syn">
00047         <!-- test global attributes name/val pairs -->
00048         <xsl:for-each select="./*">
00049           <xsl:if test="not(name()='test_suite') and not(name()='host')">
00050           <tr>
00051             <td><xsl:value-of select="name()" />:</td>
00052             <td><xsl:value-of select="." /></td>
00053           </tr>
00054          </xsl:if>
00055         </xsl:for-each>
00056       </table>
00057     </div>
00058     </td>
00059   </tr>
00060 <!-- /the unit test row -->
00061 </table>
00062 
00063 <table>
00064 <!-- test suites' rows -->
00065   <xsl:for-each select="test_suite">
00066   <xsl:variable name="style_ts" select="status" />
00067   <tr class="framed">
00068     <td>
00069       <table class="{$style_ts}">
00070         <tr>
00071           <td class="ident"><xsl:value-of select="@id"/></td>
00072           <td>
00073             <table>
00074 <!-- test suite global attributes name/val pairs -->
00075             <xsl:for-each select="./*">
00076               <xsl:if test="not(name()='test_case')">
00077               <tr>
00078                 <td><xsl:value-of select="name()" />:</td>
00079                 <td><xsl:value-of select="." /></td>
00080               </tr>
00081              </xsl:if>
00082             </xsl:for-each>
00083 <!-- /test suite global attributes name/val pairs -->
00084             </table>
00085           </td>
00086         </tr>
00087       </table>
00088     </td>
00089 <!-- test cases' data -->
00090     <td>
00091       <table>
00092 <!-- test cases' rows -->
00093       <xsl:for-each select="test_case">
00094       <xsl:variable name="style_tc" select="status" />
00095       <!-- test case id -->
00096       <tr class="{$style_tc}">
00097         <td class="ident"><xsl:value-of select="@id"/></td>
00098         <td>
00099           <table>
00100 <!-- test case global attributes name/val pairs -->
00101           <xsl:for-each select="./*">
00102           <tr>
00103             <td><xsl:value-of select="name()" />:</td>
00104             <td><xsl:value-of select="." /></td>
00105           </tr>
00106           </xsl:for-each>
00107 <!-- /test case global attributes name/val pairs -->
00108           </table>
00109         </td>
00110       </tr>
00111       </xsl:for-each>
00112 <!-- /test cases' rows -->
00113       </table>
00114     </td>
00115 <!-- /test cases' data -->
00116   </tr>
00117   </xsl:for-each>
00118 <!-- /test suites' rows -->
00119 
00120 </table>
00121 </body>
00122 </html>
00123 
00124     </xsl:document>
00125   </xsl:template>
00126 </xsl:stylesheet>
00127 
00128 <!--
00129  vim: set filetype=xml expandtab tabstop=2 shiftwidth=2 autoindent smartindent:
00130  -->

←Products
© 2005-2012 - KoanLogic S.r.l. - All rights reserved