Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The following transformation should do the trick.</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:output method="html"/&gt; &lt;xsl:template match="/"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;table&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Assemly&lt;/th&gt; &lt;th&gt;Test Fixture&lt;/th&gt; &lt;th&gt;Test Case&lt;/th&gt; &lt;th&gt;Result&lt;/th&gt; &lt;th&gt;Message&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt;&lt;xsl:for-each select="//test-case"&gt; &lt;tr&gt; &lt;td&gt;&lt;xsl:if test="count(ancestor::test-suite[@type='TestFixture']/preceding-sibling::test-suite[@type='TestFixture'])=0 and count(preceding-sibling::test-case)=0"&gt; &lt;xsl:value-of select="ancestor::test-suite[@type='Assembly']/@name" /&gt; &lt;/xsl:if&gt;&lt;/td&gt; &lt;td&gt;&lt;xsl:if test="count(preceding-sibling::test-case)=0"&gt; &lt;xsl:value-of select="ancestor::test-suite[@type='TestFixture']/@name" /&gt; &lt;/xsl:if&gt;&lt;/td&gt; &lt;td&gt;&lt;xsl:value-of select="@name"/&gt;&lt;/td&gt; &lt;xsl:choose&gt; &lt;xsl:when test="@result='Success'"&gt; &lt;td&gt;&lt;xsl:value-of select="@result"/&gt;&lt;/td&gt; &lt;td&gt;&lt;/td&gt; &lt;/xsl:when&gt; &lt;xsl:otherwise&gt; &lt;td bgcolor="red"&gt;&lt;xsl:value-of select="@result"/&gt;&lt;/td&gt; &lt;td bgcolor="red"&gt;&lt;xsl:value-of select=".//message"/&gt;&lt;/td&gt; &lt;/xsl:otherwise&gt; &lt;/xsl:choose&gt; &lt;/tr&gt; &lt;/xsl:for-each&gt;&lt;/tbody&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload