<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:param name="DSTAMP"/>
    <xsl:param name="TSTAMP"/>
    <xsl:param name="TODAY"/>

    <xsl:output method="html" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>
    <xsl:template match="/">
        <html>
            <head>
                <title>Web Services Policy 1.5 CR Dashboard (DETAILS)</title>
                <link rel="stylesheet" type="text/css"
                    href="http://www.w3.org/Guide/pubrules-style.css"/>
                <link rel="stylesheet" type="text/css"
                    href="http://www.w3.org/2006/02/charter-style.css"/>
                <style type="text/css"> body {font-family:sans-serif} td {vertical-align:top}
                    .passed {background-color:green} .failed {background-color:orange} .disaster
                    {background-color:red} .border th, .border td { border: 1px solid black;
                    padding: 0.5ex } .border th { background: #ccc } .good { background: green }
                    .bad { background: red } .group {background-color:#DDD} .heading
                    {font-weight:bold; white-space: nowrap} .explanatory {font-size:smaller}
                </style>
            </head>
            <body>
                <p class="navicons"><a href="../../../"><img src="http://www.w3.org/Icons/w3c_home"
                    alt="W3C" height="48" width="72" /> </a><xsl:text>  </xsl:text><a
                        href="http://www.w3.org/Architecture/"><img src="http://www.w3.org/Icons/arch"
                            alt="Architecture Domain" height="48" width="212" /> </a><xsl:text>  </xsl:text><a href="http://www.w3.org/2002/ws/"><img
                                src="http://www.w3.org/2002/ws/3/04/diags/wsa.png" width="192" height="48"
                                alt="Web Services Activity" /> </a></p>
                
                <p class="navlinks"><a href="http://www.w3.org/2002/ws/policy">About Web Services Policy WG</a></p>
                <h1>Web Services Policy 1.5 CR Dashboard (DETAILS)</h1>
                <xsl:if test="$TODAY">
                    <address>
                        <xsl:text>Generated </xsl:text>
                        <xsl:value-of select="$TODAY"/>,
                        <xsl:value-of select="$TSTAMP"/>
                    </address>
                </xsl:if>
                <p class="explanatory">The dashboard summarizes the results of unit and interop
                    testing of the <a href="http://www.w3.org/TR/ws-policy">Web Services Policy 1.5
                        - Framework</a> and <a href="http://www.w3.org/TR/ws-policy-attach">Web
                        Services Policy 1.5 - Attachment</a> specifications, in fulfillment of the
                    CR exit criteria (<a
                        href="http://www.w3.org/TR/2007/CR-ws-policy-20070228/#status">Framework</a>
                    and <a href="http://www.w3.org/TR/2007/CR-ws-policy-attach-20070228/#status"
                        >Attachment</a>). <a
                        href="http://dev.w3.org/cvsweb/~checkout~/2006/ws/policy/interop/">Interop
                            scenarios and test files</a> are on the W3C CVS archive. Check out the 
                            <a href="dashboard-summary.html">high level summary</a> and 
                            <a href="#features">features &amp; test 
                            coverage description</a>.</p>
                <p></p>
                <hr style="color: #C0C0C0;"></hr>
                <h2 id="implementers">Implementers</h2>
                <p>Testing is based on implementations (in alphabetical order) from:</p>
                <h4>Table 1: List of CR Participants (green indicates an interest or plan to participate)</h4>
                <table border="2" bordercolorlight="#000000" bordercolordark="#000000" style="border-collapse: collapse" cellpadding="5">
                    <tr>
                        <td>Organization</td>
                        <td>Reporter</td>
                        <xsl:for-each select="document('rounds.xml')/rounds/round">
                            <xsl:call-template name="generate-column-with-hyperlink">
                                <xsl:with-param name="name"><xsl:value-of select="name"/></xsl:with-param>
                            </xsl:call-template>
                        </xsl:for-each>
                    </tr>
                    <xsl:for-each select="document('temp-participants.xml')/participants/participant">
                        <xsl:sort select="organization"/>
                        <xsl:call-template name="generate-participant-rows"/>
                    </xsl:for-each>
                </table>
                <p></p>
                <hr style="#C0C0C0"></hr>
                
                <xsl:for-each select="document('temp-round1.xml')/round">
                    <xsl:call-template name="generate-unittest-summary">
                        <xsl:with-param name="table-number">2</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>
                
                <p></p>
                <hr style="color:#C0C0C0;"></hr>

                <xsl:for-each select="document('temp-round2-wsdl11.xml')/round">
                    <xsl:call-template name="generate-unittest-summary">
                        <xsl:with-param name="table-number">3</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>

                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <xsl:for-each select="document('temp-round2-wsdl20.xml')/round">
                    <xsl:call-template name="generate-unittest-summary">
                        <xsl:with-param name="table-number">4</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>

                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <xsl:for-each select="document('temp-round3-wsdl11.xml')/round">
                    <xsl:call-template name="generate-interoptest-summary">
                        <xsl:with-param name="table-number">5</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>

                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <xsl:for-each select="document('temp-round3-wsdl20.xml')/round">
                    <xsl:call-template name="generate-interoptest-summary">
                        <xsl:with-param name="table-number">10</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>
    
                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <!-- insert for Round-4-Media-Type-->
                <xsl:for-each select="document('temp-round4-media-type.xml')/round">
                    <xsl:call-template name="generate-interoptest-summary">
                        <xsl:with-param name="table-number">15</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>
                
                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <xsl:for-each select="document('temp-round4-external-attachment-wsdl11.xml')/round">
                    <xsl:call-template name="generate-unittest-summary">
                        <xsl:with-param name="table-number">17</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>
                
                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <xsl:for-each select="document('temp-round4-external-attachment-wsdl20.xml')/round">
                    <xsl:call-template name="generate-unittest-summary">
                        <xsl:with-param name="table-number">18</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>
                
                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <xsl:for-each select="document('temp-round4-uddi-interop.xml')/round">
                    <xsl:call-template name="generate-interoptest-summary">
                        <xsl:with-param name="table-number">19</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>
                
                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <xsl:for-each select="document('temp-round4-uddi-unittest.xml')/round">
                    <xsl:call-template name="generate-unittest-summary">
                        <xsl:with-param name="table-number">34</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>
                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <xsl:for-each select="document('temp-round4-negative-test.xml')/round">
                    <xsl:call-template name="generate-unittest-summary">
                        <xsl:with-param name="table-number">35</xsl:with-param>
                    </xsl:call-template>                    
                </xsl:for-each>
                <p></p>
                <hr style="color:#C0C0C0;"></hr>
                
                <h2>Features and Test Coverage</h2>
                <p>The following table enumerates features in the Framework and Attachment drafts,
                    identifies features that are covered by the test (s) &amp; any on-going test
                    (s) development <span style="background-color: #FFFFFF">(marked in </span>
                    <span style="background-color: #FFFF00">yellow</span>) and highlights features
                    without any test coverage (marked in <span style="background-color: #FF0000"
                        >red</span>).</p>
                <h4 id="features">Table 36: List of Features and Test Coverage</h4>
                <table border="2" bordercolorlight="#000000" bordercolordark="#000000" 
                    style="border-collapse: collapse" cellpadding="5">
                    <tr>
                        <td>Serial</td>
                        <td>Section Number</td>
                        <td>Feature</td>
                        <td>Test Case (s)</td>
                        <td>Notes</td>
                    </tr>
                    <xsl:for-each select="document('temp-features.xml')/features/feature">
                        <xsl:call-template name="generate-rows"/>
                    </xsl:for-each>
                </table>
                
            </body>
        </html>
    </xsl:template>

    <xsl:template name="generate-column">
        <xsl:param name="name"/>
        <td>{$name}</td> 
    </xsl:template>
    <xsl:template name="generate-column-with-hyperlink">
        <xsl:param name="name"/>
        <td><a href="#{$name}"><xsl:value-of select="$name"/></a></td> 
    </xsl:template>
    
    <xsl:template name="generate-rows">
        <tr>
        <xsl:for-each select="child::*">
        <td><xsl:apply-templates mode="copy"/></td>
        </xsl:for-each>
        </tr>
    </xsl:template>

<xsl:template match="*|@*" mode="copy">
<xsl:copy-of select="."/>
</xsl:template>

    <xsl:template name="generate-summary"/>
    
    <xsl:template name="generate-participant-rows">
        <tr>
            <xsl:variable name="organization" select="organization"/>
            <td id="{$organization}"><xsl:value-of select="organization"/></td>
            
            <td><xsl:for-each select="reporter/a">
                <xsl:copy-of select="."/><br/>
            </xsl:for-each></td>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-1"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-2-WSDL11"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-2-WSDL20"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-3-WSDL11"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-3-WSDL20"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-4-Media-Type"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-4-External-Policy-Attachment-WSDL11"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-4-External-Policy-Attachment-WSDL20"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-4-UDDI-Attachment-Interop"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-4-UDDI-Attachment-Unittest"/></xsl:with-param>
            </xsl:call-template>
            <xsl:call-template name="bgcolor">
                <xsl:with-param name="yes"><xsl:value-of select="Round-4-Negative-Test"/></xsl:with-param>
            </xsl:call-template>
        </tr>        
    </xsl:template>
    
    <xsl:template name="bgcolor">
        <xsl:param name="yes"/>
        <xsl:choose>
            <xsl:when test="$yes='Yes'">
                <td bgcolor="#00FF00"></td>
            </xsl:when>
            <xsl:otherwise>
                <td></td>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
    
    <xsl:template name="generate-unittest-summary">
        <xsl:param name="table-number"/>
        <xsl:variable name="name" select="name"/>               
        <h2 id="{$name}"><xsl:value-of select="label"/></h2>
        <p><xsl:value-of select="description"/> The following table enumerates 
            results from implementers based on running these unit tests. Green indicates a 
            successful outcome, red indicates a failure and no color indicates 'no claims'.</p>
        <h4>Table <xsl:value-of select="$table-number"/>: Results from <xsl:value-of select="$name"/> Testing</h4>
        <table border="2" bordercolorlight="#000000" bordercolordark="#000000" 
            style="border-collapse: collapse" cellpadding="5">
            <tr>
                <td>Name</td>
                <td>Description</td>
                <xsl:for-each select="participantref">
                    <xsl:call-template name="generate-column-with-hyperlink">
                        <xsl:with-param name="name"><xsl:value-of select="."/></xsl:with-param>
                    </xsl:call-template>
                </xsl:for-each>
            </tr>
            <xsl:for-each select="testcase">
                <tr>
                    <xsl:variable name="id" select="name"/>
                    <td id="{$id}"><xsl:value-of select="name"/></td>
                    <td><xsl:value-of select="description"></xsl:value-of></td>
                    <xsl:for-each select="description">
                        <xsl:for-each select="following-sibling::*">
                            <xsl:variable name="passed" select="."></xsl:variable>
                            <xsl:choose>
                                <xsl:when test="$passed='true'">
                                    <td bgcolor="#00FF00"></td>
                                </xsl:when>
                                <xsl:when test="$passed='false'">
                                    <td bgcolor="#FF0000"></td>
                                </xsl:when>
                                <xsl:otherwise>
                                    <td></td>
                                </xsl:otherwise>
                            </xsl:choose>
                        </xsl:for-each>
                    </xsl:for-each>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>
    
    <xsl:template name="generate-interoptest-summary">
        <xsl:param name="table-number"/>
        <xsl:variable name="name" select="name"/>
        <h2 id="{$name}"><xsl:value-of select="label"/></h2>
        <p><xsl:value-of select="description"/></p>
        
        <h4 id="{$name}-endpoints">Table <xsl:value-of select="$table-number"/>: <xsl:value-of select="$name"/> Endpoints</h4>
        <table border="2" bordercolorlight="#000000" bordercolordark="#000000" 
            style="border-collapse: collapse" cellpadding="5">
        <xsl:for-each select="participantref">            
                <tr>
                    <xsl:variable name="provider" select="."/>
                    <td><a href="#{$provider}"><xsl:value-of select="."/></a></td>                 
                    <td><xsl:for-each select="following-sibling::endpoints[1]/endpoint">
                        <xsl:variable name="URI" select="URI"></xsl:variable>
                        <xsl:value-of select="label"/>: <a href="{$URI}"><xsl:value-of select="URI"/></a><br/>                       
                    </xsl:for-each>
                    </td>
                </tr>
        </xsl:for-each>
        </table>
        <p>The following tables enumerate 
            results from implementers based on running these interop tests. Green indicates a 
            successful outcome, red indicates a failure and no color indicates 'no claims'.</p>
        <xsl:for-each select="testcase">
            <xsl:variable name="testcase-name" select="name"/>
            <h4 id="{$testcase-name}">Table <xsl:value-of select="$table-number+ count(preceding-sibling::testcase) + 1"/>: Test Case - <xsl:value-of select="name"/></h4>
            <p><xsl:value-of select="description"/></p>
            <table border="2"  bordercolorlight="#000000" bordercolordark="#000000" style="border-collapse: 
            collapse" cellpadding="5">
                <tr>
                    <td>Requestor/Provider</td>
                    <xsl:for-each select="../participantref">
                        <xsl:variable name="provider" select="."/>
                        <td><a href="#{$provider}"><xsl:value-of select="."/></a></td>
                    </xsl:for-each>
                </tr>
                <xsl:for-each select="result">
                    <tr>
                        <xsl:variable name="requestor" select="requestor"/>
                        <td><a href="#{$requestor}"><xsl:value-of select="requestor"/></a></td>
                        <xsl:for-each select="requestor">
                            <xsl:apply-templates mode="sortparticipants" select="following-sibling::*">
                                <xsl:sort select="name()"/>
                            </xsl:apply-templates>
                        </xsl:for-each>
                    </tr>
                </xsl:for-each>
            </table>   
        </xsl:for-each>
    </xsl:template>
    <xsl:template mode="sortparticipants" match="*">        
                                <xsl:variable name="passed" select="."></xsl:variable>
                                <xsl:choose>
                                    <xsl:when test="$passed='true'">
                                        <td bgcolor="#00FF00"></td>
                                    </xsl:when>
                                    <xsl:when test="$passed='false'">
                                        <td bgcolor="#FF0000"></td>
                                    </xsl:when>
                                    <xsl:otherwise>
                                        <td></td>
                                    </xsl:otherwise>
                                </xsl:choose>
    </xsl:template>
</xsl:stylesheet>
