123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:template match="/">
- <html>
- <body>
- <h2>软件信息清单</h2>
- <table border="1">
- <tr>
- <th>机芯:</th>
- <th>
- <xsl:value-of select="all/SW_Information/hardware"/>
- </th>
- </tr>
- <tr>
- <th>软件版本:</th>
- <th>
- <xsl:value-of select="all/SW_Information/SWVersion"/>
- </th>
- </tr>
- <tr>
- <th>机型:</th>
- <th>
- <xsl:value-of select="all/SW_Information/projectName"/>
- </th>
- </tr>
- <tr>
- <th>ProjectID:</th>
- <th>
- <xsl:value-of select="all/SW_Information/projectID"/>
- </th>
- </tr>
- <tr>
- <th>软件综合信息:</th>
- <th>
- <xsl:value-of select="all/SW_Information/SWInclude"/>
- </th>
- </tr>
- </table>
- <h2>测试结果汇总表</h2>
- <xsl:for-each select="results/item">
- <xsl:sort select="result"/>
- <table border="1" table-layout="fixed" word-wrap="break-word">
- <tr bgcolor="#9acd32">
- <th>子项名称</th>
- <th>子项结果</th>
- <th>结果数据</th>
- <th>日志路径</th>
- <th>备注</th>
- </tr>
- <tr>
- <td>
- <xsl:value-of select="name"/>
- </td>
- <xsl:choose>
- <xsl:when test="result = 'Fail'">
- <td bgcolor="#ff00ff">
- <xsl:value-of select="result"/>
- </td>
- </xsl:when>
- <xsl:otherwise>
- <td>
- <xsl:value-of select="result"/>
- </td>
- </xsl:otherwise>
- </xsl:choose>
- <td>
- <xsl:value-of select="data"/>
- </td>
- <td>
- <xsl:variable name="loghref" select="log" />
- <a href="{$loghref}">
- <xsl:value-of select="log" />
- </a>
- </td>
- <td>
- <xsl:value-of select="remark"/>
- </td>
- </tr>
- <xsl:variable name="cols" select="4" />
- <xsl:variable name="index" select="0" />
- <table border="1" table-layout="fixed" word-wrap="break-word">
- <th bgcolor="#9acd32">截图路径</th>
- <xsl:for-each select="screen[ (position() -1) mod $cols = 0]">
- <tr>
- <xsl:if test="position() = 1">
- <td>
- <xsl:variable name="screenhref" select="." />
- <a href="{$screenhref}">
- <xsl:value-of select="." />
- </a>
- </td>
- </xsl:if>
- <xsl:for-each select="following-sibling::screen[(position() - 1) < $cols]">
- <td>
- <xsl:variable name="screenhref" select="." />
- <a href="{$screenhref}">
- <xsl:value-of select="." />
- </a>
- </td>
- </xsl:for-each>
- </tr>
- </xsl:for-each>
- </table>
- <tr border="1" bgcolor="#ff00ff"></tr>
- </table>
- </xsl:for-each>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
|