<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
            doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
            method="xml"
            media-type="text/html"
            indent="yes"
            encoding="ISO-8859-1" />

<xsl:template match="/">
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"/>
    <title>iBus Repository Description</title>

    <meta name="anchor-author" content="Martin Burger" />
    <meta http-equiv="content-language" content="en" />

</head>
<body>

<xsl:for-each select="/bugrepository/bug">

    <div class="bug">

    <hr/>

    <h2><xsl:attribute name="id">position_<xsl:value-of select="position()" /></xsl:attribute>
        Bug <a><xsl:attribute name="href">https://bugs.eclipse.org/bugs/show_bug.cgi?id=<xsl:value-of select="@id" /></xsl:attribute>
            #<xsl:value-of select="@id" /></a> (Transaction #<xsl:value-of select="@transactionid" />)

    </h2>

        <div class="navigation">
            [<a><xsl:attribute name="href">#position_<xsl:value-of select="position() - 1" /></xsl:attribute>
            prev</a>]

            <xsl:value-of select="position()" /> of <xsl:value-of select="count(/bugrepository/bug)" />

            [<a><xsl:attribute name="href">#position_<xsl:value-of select="position() + 1" /></xsl:attribute>
            next</a>]
        </div>


        <div class="bugreport">
            <h3>Bugreport</h3>
            <pre><xsl:value-of select="bugreport" /></pre>
        </div>

        <div class="properties">
            <h3>Properties</h3>

            <table>
                <tr>
        <xsl:apply-templates select="property" mode="name"/>
                </tr>
                <tr>
        <xsl:apply-templates select="property" mode="value"/>
                </tr>
            </table>
        </div>

        <div class="fingerprints">
            <h3>Fingerprints</h3>
            <table>
                <tr>
                    <th>Concise Fingerprint</th>
                    <xsl:apply-templates select="concisefingerprint"/>
                </tr>
                <tr>
                    <th>Full Fingerprint</th>
                    <xsl:apply-templates select="fullfingerprint"/>
                </tr>
            </table>
        </div>

        <div class="testcases">
            <h3>Test Cases</h3>

            <table>
                <tr>
                    <th class="empty"></th>
                    <th>Failing</th>
                    <th>Passing</th>
                    <th>Size</th>
                    <th>File</th>
                </tr>
                <tr>
                    <td>Pre-Fix</td>
                    <td><xsl:apply-templates select="pre-fix-testcases/@failing"/></td>
                    <td><xsl:apply-templates select="pre-fix-testcases/@passing"/></td>
                    <td><xsl:apply-templates select="pre-fix-testcases/@size"/></td>
                    <td><xsl:apply-templates select="pre-fix-testcases/@file"/></td>
                </tr>
                <tr>
                    <td>Post-Fix</td>
                    <td><xsl:apply-templates select="post-fix-testcases/@failing"/></td>
                    <td><xsl:apply-templates select="post-fix-testcases/@passing"/></td>
                    <td><xsl:apply-templates select="post-fix-testcases/@size"/></td>
                    <td><xsl:apply-templates select="post-fix-testcases/@file"/></td>
                </tr>
            </table>

        </div>

        <div class="fixedfiles">
            <h3>Fixed Files</h3>
            <xsl:apply-templates select="fixedFiles/file"/>
        </div>


    </div>

</xsl:for-each>

</body>
</html>
</xsl:template>


<xsl:template match="property" mode="name">
        <th class="name"><xsl:value-of select="@name" /></th>
</xsl:template>

<xsl:template match="property" mode="value">
        <td class="value"><xsl:value-of select="@value" /></td>
</xsl:template>

<xsl:template match="concisefingerprint">
        <td class="concise"><xsl:value-of select="." /></td>
</xsl:template>

<xsl:template match="fullfingerprint">
        <td class="full"><xsl:value-of select="." /></td>
</xsl:template>

<xsl:template match="fixedFiles/file">

        <table>
            <tr>
                <th>File Name</th>
                <th>Revision</th>
                <th>State</th>
            </tr>
            <tr>
                <td><xsl:value-of select="@name" /></td>
                <td><xsl:value-of select="@revision" /></td>
                <td><xsl:value-of select="@state" /></td>
            </tr>
        </table>


        <pre><xsl:value-of select="." /></pre>
</xsl:template>


</xsl:stylesheet>


