<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">



<xsl:output method="html"/>

<xsl:param name="stochastic" select="false()"/>

<xsl:template match="/release-plan">
    <html>
    <head>
    <title>
	<xsl:value-of select="product"/> 
	<xsl:text> </xsl:text>
	<xsl:value-of select="release/designator"/> 
	Release Plan
    </title>
    </head>
    <body background="binary.jpg">
	<h2>
	    <xsl:value-of select="product"/>
	    <xsl:text> </xsl:text>
	    <xsl:value-of select="release/designator"/>
	    Release Plan
	</h2>
	<xsl:call-template name="headinfo"/>
	<p>
	(follow the <a target="other" href="def.html#rp">links</a> for definitions and explanations of the terms used).
	</p>
	<hr/>
	<xsl:apply-templates select="release"/>
	<xsl:apply-templates select="mission"/>
	<xsl:apply-templates select="status"/>
	<xsl:apply-templates select="capacity"/>
	<xsl:apply-templates select="requirement"/>
	<xsl:apply-templates select="version-control-info"/>
	<xsl:call-template name="copyright"/>
    </body>
    </html>
</xsl:template>

<xsl:template match="version-control-info">
    <h4><a target="other" href="def.html#vci">Release Plan Document Version Control Information</a></h4>
    <table border="0">
	<tr>
	    <td><a target="other" href="def.html#vci.v">version:</a></td>
	    <td><xsl:value-of select="version"/></td>
	    <td></td>
	</tr>
	<tr>
	    <td><a target="other" href="def.html#vci.lpc">last plan change:</a></td>
	    <td><xsl:value-of select="last-plan-change/when"/></td>
	    <td><xsl:value-of select="last-plan-change/whom"/></td>
	</tr>
	<tr>
	    <td><a target="other" href="def.html#vci.la">last approval:</a></td>
	    <td><xsl:value-of select="last-approval/when"/></td>
	    <td><xsl:value-of select="last-approval/whom"/></td>
	</tr>
	<tr>
	    <td><a target="other" href="def.html#vci.lu">last update:</a></td>
	    <td><xsl:value-of select="last-update/when"/></td>
	    <td><xsl:value-of select="last-update/whom"/></td>
	</tr>
    </table>
    <hr/>
</xsl:template>

<xsl:template match="release">
    <h4><a target="other" href="def.html#prd">Planned Release Dates</a></h4>
    <table border="0">
	<tr>
	    <td><a target="other" href="def.html#prd.r">Release:</a></td>
	    <td><xsl:value-of select="designator"/></td>
	</tr>
	<xsl:for-each select="phase">
	    <tr>
		<td>
		    <a target="other">
			<xsl:attribute name="href">def.html#prd.<xsl:value-of select="name"/></xsl:attribute>
			<xsl:value-of select="label"/>:
		    </a>
		</td>

		<td>
		    <xsl:choose><xsl:when test="@type='planned' or preceding-sibling::phase[1]/@type='planned'">
			<b><xsl:value-of select="start"/></b>
		    </xsl:when><xsl:otherwise>
			<xsl:value-of select="start"/>
		    </xsl:otherwise></xsl:choose>
		</td>

		<xsl:if test="position() > 1">
		    <td>
			<xsl:choose><xsl:when test="preceding-sibling::phase[1]/@type='planned'">
			    (<b><xsl:value-of select="preceding-sibling::phase[1]/duration"/>
			    <xsl:text> </xsl:text>
			    <xsl:value-of select="preceding-sibling::phase[1]/duration/@units"/>
			    </b>)
			</xsl:when><xsl:otherwise>
			    (<xsl:value-of select="preceding-sibling::phase[1]/duration"/>
			    <xsl:text> </xsl:text>
			    <xsl:value-of select="preceding-sibling::phase[1]/duration/@units"/>)
			</xsl:otherwise></xsl:choose>
		    </td>
		</xsl:if>
	    </tr>

	    <xsl:if test="position()=last()">
		<tr>
		    <td>
			<a target="other">
			    <xsl:attribute name="href">
				def.html#prd.<xsl:value-of select="name"/>end
			    </xsl:attribute>
			    <xsl:value-of select="label[@type='end']"/>:
			</a>
		    </td>
		    <td><xsl:value-of select="end"/></td>
		    <td>
		        (<xsl:value-of select="duration"/>
			<xsl:text> </xsl:text>
			<xsl:value-of select="duration/@units"/>)
		    </td>
		</tr>
	    </xsl:if>
	</xsl:for-each >
    </table>
    <hr/>
</xsl:template>

<xsl:template match="mission">
    <h4><a target="other" href="def.html#m">Mission</a></h4>
    <table width="600" border="0">
	<xsl:value-of select="."/>
    </table>
    <hr/>
</xsl:template>

<xsl:template match="status">
    <h4><a target="other" href="def.html#css">Current Status Summary</a></h4>
    <xsl:call-template name="estasat"/>

    <table border="1" rules="groups">
	<colgroup span="2"/>
	<colgroup span="4"/>

	<xsl:if test="$stochastic">
	    <thead>
		<tr><th/><th/><th colspan="2"><i>mean</i></th><th colspan="2"><i>sdev</i></th></tr>
	    </thead>
	</xsl:if>

	<tbody>
	    <tr>
	        <td colspan="2"><a target="other" href="def.html#css.rc">Remaining coding capacity:</a></td>
		<xsl:apply-templates select="capacity/estimate"/>
	    </tr>
	</tbody>

	<tbody>
	    <tr>
		<td colspan="2"><a target="other" href="def.html#css.ac">Average coders:</a></td>
		<xsl:apply-templates select="coders/estimate"/>
	    </tr>
	</tbody>

	<xsl:for-each select="feature-set-status">
	    <tbody>
		<tr>
		    <th align="left" rowspan="2">
		        <a target="other" href="def.html#css.abf">
			    <xsl:attribute name="href">
				def.html#css.<xsl:value-of select="translate(feature-set,' ','')"/>
			    </xsl:attribute>
			    <xsl:value-of select="feature-set"/>
			</a>
		    </th>
		    <td><a target="other" href="def.html#css.r">Remaining coding requirement:</a></td>
		    <xsl:apply-templates select="requirement/estimate"/>
		</tr>
		<tr>
		    <td><a target="other" href="def.html#css.d">Delta:</a></td>
		    <xsl:apply-templates select="delta/estimate"/>
		</tr>
	    </tbody>
	</xsl:for-each>
    </table>

    <xsl:if test="$stochastic">
	<xsl:apply-templates select="projections"/>
    </xsl:if>
    <hr/>
</xsl:template>

<xsl:template match="capacity">
    <h4><a target="other" href="def.html#c">Capacity</a></h4>
    <xsl:call-template name="estasat"/>
    <table border="1" rules="groups">
	<colgroup>
	    <col/>			<!-- coder -->
	    <col/>			<!-- class -->
	</colgroup>
	<colgroup>
	    <col align="center"/>	<!-- days -->
	</colgroup>
	<colgroup>			<!-- vacation -->
	    <col align="right"/>
	    <col align="center"/>
	    <col align="left"/>
	</colgroup>
	<colgroup>			<!-- work factor -->
	    <col align="right"/>
	    <col align="center"/>
	    <col align="left"/>
	</colgroup>
	<colgroup>
	    <col/>
	</colgroup>
	<colgroup>			<!-- effective days -->
	    <col align="right"/>
	    <col align="center"/>
	    <col align="left"/>
	</colgroup>
	<colgroup>
	    <col/>
	</colgroup>
	<colgroup>
	    <col align="center"/>	<!-- to date -->
	    <col/>			<!-- w -->
	</colgroup>
	<colgroup>
	    <col/>
	</colgroup>
	<colgroup>
	    <xsl:for-each select="work-totals/committed">
		<xsl:choose><xsl:when test="position()=1">
		    <col align="left"/>
		</xsl:when><xsl:when test="position()=last()">
		    <col align="right"/>
		</xsl:when><xsl:otherwise>
		    <col align="center"/>
		</xsl:otherwise></xsl:choose>
	    </xsl:for-each>
	</colgroup>

	<thead>
	    <tr>
		<th><i><a target="other" href="def.html#c.c">Coder</a></i></th>
		<th><i><a target="other" href="def.html#c.cl">Class</a></i></th>
		<th><i><a target="other" href="def.html#c.d">Days</a></i></th>
		<th colspan="3"><i><a target="other" href="def.html#c.v">Vacation</a></i></th>
		<th colspan="3"><i><a target="other" href="def.html#c.w">Work Factor</a></i></th>
		<th width="10"/>
		<th colspan="3"><i><a target="other" href="def.html#c.e">Effective Days</a></i></th>
		<th width="10"/>
		<th><i><a target="other" href="def.html#c.t">To Date</a></i></th>
		<th align="center"><i><a target="other" href="def.html#c.a">w(act.)</a></i></th>
		<th width="10"></th>
		<xsl:for-each select="work-totals/committed">
		    <th align="center">
		        <i>
			    <a target="other">
				<xsl:attribute name="href">
				    def.html#c.c.<xsl:value-of select="translate(feature-set,' ','')"/>
				</xsl:attribute>
				<xsl:value-of select="feature-set"/>
			    </a>
			</i>
		    </th>
		</xsl:for-each>
	    </tr>
	</thead>
	<tbody>
	    <xsl:for-each select="coder">
		<tr>
		    <td><xsl:value-of select="name"/></td>
		    <td><xsl:value-of select="class"/></td>
		    <td><xsl:value-of select="days"/></td>
		    <xsl:apply-templates select="vacation/estimate"/>
		    <xsl:apply-templates select="work-factor/estimate"/>
		    <td/>
		    <xsl:apply-templates select="effective-days/estimate"/>
		    <td/>
		    <td><xsl:value-of select="to-date"/></td>
		    <td><xsl:value-of select="work-factor-to-date"/></td>
		    <td/>
		    <xsl:for-each select="committed">
			<td><xsl:value-of select="format-number(estimate/mean,'+0.#;-0.#')"/></td>
		    </xsl:for-each>
		</tr>
	    </xsl:for-each>
	</tbody>
	<tbody>
	    <tr>
		<td align="center" colspan="2"><i><a target="other" href="def.html#c.tot">totals:</a></i></td>
		<td><xsl:value-of select="/totals/days"/></td>
		<xsl:apply-templates select="totals/vacation/estimate"/>
		<xsl:apply-templates select="totals/work-factor/estimate"/>
		<td/>
		<xsl:apply-templates select="totals/effective-days/estimate"/>
		<td/>
		<td><xsl:value-of select="totals/to-date"/></td>
		<td><xsl:value-of select="totals/work-factor-to-date"/></td>
		<td/>
		<xsl:for-each select="totals/committed">
		    <td><xsl:value-of select="format-number(estimate/mean,'+0.#;-0.#')"/></td>
		</xsl:for-each>
	    </tr>
	</tbody>
	<tbody>
	    <tr>
		<td colspan="13"/>
		<td colspan="4" align="center"><a target="other" href="def.html#c.u">Unassigned:</a></td>
		<xsl:for-each select="unassigned/committed">
		    <td><xsl:value-of select="format-number(estimate/mean,'+0.#;-0.#')"/></td>
		</xsl:for-each>
	    </tr>
	    <tr>
		<td colspan="13"/>
		<td colspan="4" align="center"><a target="other" href="def.html#c.f">Final Totals:</a></td>
		<xsl:for-each select="work-totals/committed">
		    <td><xsl:value-of select="format-number(estimate/mean,'+0.#;-0.#')"/></td>
		</xsl:for-each>
	    </tr>
	</tbody>
    </table>
    <hr/>
</xsl:template>

<xsl:template match="requirement">
    <h4><a target="other" href="def.html#r">Requirement</a></h4>
    <xsl:call-template name="estasat"/>
    <table border="1" rules="groups">
	<colgroup>
	    <col align="center"/>	<!--fid-->
	    <col/>			<!--description-->
	</colgroup>
	<colgroup>
	    <col align="center"/>	<!--prereq-->
	    <col align="center"/>	<!--prio-->
	    <col/>			<!--promised-->
	    <col/>			<!--assigned-->
	</colgroup>
	<colgroup>
	    <col align="right"/>	<!--estimate-->
	    <col align="center"/>
	    <col align="left"/>
	</colgroup>
	<colgroup>
	    <col/>			<!--status-->
	    <col align="center"/>	<!--to date-->
	    <col align="right"/>	<!--remaining-->
	    <col align="center"/>
	    <col align="left"/>
	</colgroup>
	<colgroup>
	    <col align="center"/>	<!--spec-->
	    <col align="center"/>	<!--design-->
	</colgroup>

	<thead>
	    <tr>
		<th><i><a target="other" href="def.html#r.f">fid</a></i></th>
		<th align="left"><i><a target="other" href="def.html#r.d">description</a></i></th>
		<th><i><a target="other" href="def.html#r.pr">prereq</a></i></th>
		<th><i><a target="other" href="def.html#r.p">prio</a></i></th>
		<th><i><a target="other" href="def.html#r.c">promised</a></i></th>
		<th><i><a target="other" href="def.html#r.a">assigned</a></i></th>
		<th colspan="3" align="center"><i><a target="other" href="def.html#r.e">initial</a></i></th>
		<th><i><a target="other" href="def.html#r.s">status</a></i></th>
		<th><i><a target="other" href="def.html#r.t">to date</a></i></th>
		<th colspan="3" align="center"><i><a target="other" href="def.html#r.r">remain</a></i></th>
		<th><i><a target="other" href="def.html#r.sp">spec</a></i></th>
		<th><i><a target="other" href="def.html#r.de">design</a></i></th>
	    </tr>
	</thead>

	<tbody>
	    <xsl:apply-templates select="feature[feature-set='A']"/>
	</tbody>
	<tbody>
	    <xsl:apply-templates select="totals[feature-set='A']"/>
	</tbody>
	<tbody>
	    <xsl:apply-templates select="feature[feature-set='B']"/>
	</tbody>
	<tbody>
	    <xsl:apply-templates select="totals[feature-set='A+B']"/>
	</tbody>
    </table>
    <hr/>
</xsl:template>

<xsl:template name="estasat">
    <table border="0">
    <tr>
	<td>
	    <a target="other">
		<xsl:attribute name="href">
		    <xsl:choose><xsl:when test="$stochastic">
		        def.html#ess
		    </xsl:when><xsl:otherwise>
		        def.html#esd
		    </xsl:otherwise></xsl:choose>
		</xsl:attribute>
		Estimates:
	    </a>
	</td>
	<td>
	    <xsl:choose><xsl:when test="$stochastic">
		are Normal with the given mean and standard deviation.
	    </xsl:when><xsl:otherwise>
		are made at an 80% worst case level.
	    </xsl:otherwise></xsl:choose>
	</td>
    </tr>
    <tr>
	<td><a target="other" href="def.html#aa">As at:</a></td>
	<td>EOD Fri, Nov 10 2000 (<b>Coding</b> phase: <b>10</b> of 74 working days elapsed).</td>
    </tr>
    </table>
    <br/>
</xsl:template>

<xsl:template match="projections">
    <br/><br/>
    <table border="1" rules="groups">
	<colgroup align="left"/>
	<colgroup align="center"/>
	<colgroup align="center"/>
	<colgroup align="center"/>
	<colgroup align="center"/>
	<colgroup align="center"/>
	<thead>
	    <tr>
		<td align="center" colspan="6"><b><a target="other" href="def.html#css.aab"><xsl:value-of select="feature-set"/></a></b></td>
	    </tr>
	</thead>
	<tbody>		
	    <tr>
	        <td><a target="other" href="def.html#css.c">Confidence:</a></td>
		<xsl:for-each select="projection">
		    <td>
			<xsl:choose><xsl:when test="dcut-slip">
			    <xsl:value-of select="confidence"/>
			</xsl:when><xsl:otherwise>
			    <b><xsl:value-of select="confidence"/></b>
			</xsl:otherwise></xsl:choose>
		    </td>
		</xsl:for-each>
	    </tr>
	    <tr>
	        <td><a target="other" href="def.html#css.cs">DCUT Slip (<xsl:value-of select="projection/dcut-slip/attribute::units"/>):</a></td>
		<xsl:for-each select="projection">
		    <td>
			<xsl:choose><xsl:when test="dcut-slip">
			    <xsl:value-of select="format-number(dcut-slip,'+#;-#')"/>
			</xsl:when><xsl:otherwise>
			    on-time
			</xsl:otherwise></xsl:choose>
		    </td>
		</xsl:for-each>
	    </tr>
	    <tr>
	        <td><a target="other" href="def.html#css.p">Projected GA:</a></td>
		<xsl:for-each select="projection">
		    <td>
			<xsl:value-of select="ga"/>
		    </td>
		</xsl:for-each>
	    </tr>
	</tbody>
    </table>
</xsl:template>

<xsl:template match="feature">
    <tr>
	<td><xsl:value-of select="id"/></td>
	<td><xsl:value-of select="description"/></td>
	<td>
	    <xsl:for-each select="prereq">
		<xsl:value-of select="."/>
		<xsl:if test="position()!=last()">, </xsl:if>
	    </xsl:for-each>
	</td>
	<td><xsl:value-of select="feature-set"/></td>
	<td>
	    <xsl:for-each select="promised">
		<xsl:value-of select="."/>
		<xsl:if test="position()!=last()">, </xsl:if>
	    </xsl:for-each>
	 </td>
	 <td>
	     <xsl:for-each select="assigned">
		 <xsl:value-of select="."/>
		 <xsl:if test="position()!=last()">, </xsl:if>
	     </xsl:for-each>
        </td>
        <xsl:apply-templates select="initial-sizing/estimate"/>
	<td><xsl:value-of select="status"/></td>
	<td><xsl:value-of select="to-date"/></td>
        <xsl:apply-templates select="remaining-sizing/estimate"/>
	<td><xsl:apply-templates select="document[@type='specification']"/></td>
        <td><xsl:apply-templates select="document[@type='design']"/></td>
    </tr>
</xsl:template>

<xsl:template match="requirement/totals">
    <tr>
	<td colspan="6">
	    <b>
	        <a target="other" href="def.html#r.tot">
		    totals (<xsl:value-of select="feature-set"/>)
		</a>
	    </b>
	</td>
        <xsl:apply-templates select="initial-sizing/estimate"/>
	<td><xsl:value-of select="status"/></td>
	<td><xsl:value-of select="to-date"/></td>
        <xsl:apply-templates select="remaining-sizing/estimate"/>
	<xsl:for-each select="document[@type='specification']">
	    <td><xsl:value-of select="complete"/></td>
	</xsl:for-each>
	<xsl:for-each select="document[@type='design']">
	    <td><xsl:value-of select="complete"/></td>
	</xsl:for-each>
    </tr>
</xsl:template>

<xsl:template match="feature/document">
    <xsl:choose><xsl:when test="href">
    <a>
	<xsl:attribute name="href">
	    <xsl:value-of select="href"/>
	</xsl:attribute>
	<xsl:value-of select="status"/>
    </a>
    </xsl:when><xsl:otherwise>
	<xsl:value-of select="status"/>
    </xsl:otherwise></xsl:choose>
</xsl:template>

<xsl:template match="feature/tests">
    <xsl:choose><xsl:when test="href">
    <a>
	<xsl:attribute name="href">
	    <xsl:value-of select="href"/>
	</xsl:attribute>
	<xsl:value-of select="done"/>/<xsl:value-of select="attempted"/>/<xsl:value-of select="planned"/>
    </a>
    </xsl:when><xsl:otherwise>
	<xsl:value-of select="done"/>/<xsl:value-of select="attempted"/>/<xsl:value-of select="planned"/>
    </xsl:otherwise></xsl:choose>
</xsl:template>

<xsl:template match="estimate">
    <xsl:choose><xsl:when test="$stochastic">
	<td><xsl:value-of select="mean"/></td>
	<xsl:if test="@units">
	    <td><xsl:value-of select="@units"/></td>
	</xsl:if>
	<xsl:choose><xsl:when test="sdev">
	    <td>&#177;</td>
	    <td><xsl:value-of select="format-number(sdev,'0.#')"/></td>
	</xsl:when><xsl:otherwise>
	    <td/>
	    <td/>
	</xsl:otherwise></xsl:choose>
    </xsl:when><xsl:otherwise>
	<td align="center" colspan="3"><xsl:value-of select="mean"/></td>
	<xsl:if test="@units">
	    <td><xsl:value-of select="@units"/></td>
	</xsl:if>
    </xsl:otherwise></xsl:choose>
</xsl:template>

<xsl:template name="headinfo">
    <table width="600" border="0">
	<tr><td colspan="4">
	    <font size="-1">
		This is an example report used to illustrate release planning concepts.<br/>
		The company and product referred to in the report are fictional.<br/>
		For information on release planning, contact
	    </font>
	</td></tr>
	<tr><td width="20"/><td colspan="3">
	    <font size="-1">
		Prof. David A. Penny
	    </font>
	</td></tr>
	<tr><td/><td colspan="3">
	    <font size="-1">
		Department of Computer Science, University of Toronto,
	    </font>
	</td></tr>
	<tr><td/><td width="20"/><td>
	    <font size="-1">
		e-mail:
	    </font>
	</td><td>
	    <font size="-1">
		<a href="mailto:penny@cs.toronto.edu">penny@cs.toronto.edu</a>
	    </font>
	</td></tr>
	<tr><td/><td/><td>
	    <font size="-1">
		web:
	    </font>
	</td><td>
	    <font size="-1">
		<a href="http://www.cs.toronto.edu/~penny">http://www.cs.toronto.edu/~penny</a>
	    </font>
	</td></tr>
	<tr><td/><td/><td>
	    <font size="-1">
		phone:
	    </font>
	</td><td>
	    <font size="-1">
		+1 (416) 978-1675
	    </font>
	</td></tr>
    </table>
</xsl:template>

<xsl:template name="copyright">
    <p>
	<font size="-1">
	    Copyright &#169; 2001, David A. Penny. All rights reserved.
	</font>
    </p>
</xsl:template>



</xsl:stylesheet>

