123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?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>
- <h2>Case详细步骤结果</h2>
- <body>
- <div>
- <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>
- </div>
- </body>
- </html>
- </xsl:template>
- </xsl:stylesheet>
|