|
From: <rga...@us...> - 2002-11-10 14:51:29
|
Update of /cvsroot/csms/csms-core/src/resources/conf
In directory usw-pr-cvs1:/tmp/cvs-serv28139
Modified Files:
ScoringConfig.xsl Scores2HTML.xsl
Log Message:
Changed the DTD of the scores.xml document to better suit later work with the data within it.
Index: ScoringConfig.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/ScoringConfig.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ScoringConfig.xsl 4 Nov 2002 22:49:34 -0000 1.6
--- ScoringConfig.xsl 10 Nov 2002 14:51:25 -0000 1.7
***************
*** 37,40 ****
--- 37,41 ----
<!-- Goalkeepers, Full Backs and Centre Backs will lose 1 point for every goal conceded whilst they are on the pitch. -->
<xsl:call-template name="goalsConceeded" />
+
<xsl:call-template name="ownGoalsConceeded" />
***************
*** 398,418 ****
</xsl:variable>
! <xsl:call-template name="deductDefenderPoints">
<xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes"/>
</xsl:with-param>
<xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam"/>
</xsl:with-param>
<xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam"/>
</xsl:with-param>
<xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID"/>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
!
<!-- =========================================================================== -->
<!-- FIXME: The goalsconceeded and ownGoalsConceeded templates are very similar -->
--- 399,422 ----
</xsl:variable>
! <xsl:call-template name="deductDefenderPoints">
<xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes" />
</xsl:with-param>
+
<xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam" />
</xsl:with-param>
+
<xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam" />
</xsl:with-param>
+
<xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID" />
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
</xsl:template>
!
<!-- =========================================================================== -->
<!-- FIXME: The goalsconceeded and ownGoalsConceeded templates are very similar -->
***************
*** 420,424 ****
<!-- of the initial parameters needs to be different -->
<!-- =========================================================================== -->
-
<!-- Goalkeepers, Full Backs and Centre Backs will lose 1 point for every goal conceded whilst they are on the pitch. -->
<xsl:template name="ownGoalsConceeded">
--- 424,427 ----
***************
*** 455,459 ****
</xsl:choose>
</xsl:variable>
!
<xsl:variable name="scoringTeamID">
<xsl:call-template name="getTeamID">
--- 458,462 ----
</xsl:choose>
</xsl:variable>
!
<xsl:variable name="scoringTeamID">
<xsl:call-template name="getTeamID">
***************
*** 463,653 ****
</xsl:call-template>
</xsl:variable>
!
<xsl:call-template name="deductDefenderPoints">
<xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes"/>
</xsl:with-param>
<xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam"/>
</xsl:with-param>
<xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam"/>
</xsl:with-param>
<xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID"/>
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
! </xsl:template>
!
<!-- Deduct points from defenders and goalkeepers who have conceeded a goal -->
! <xsl:template name="deductDefenderPoints">
! <xsl:param name="goalMinutes"/>
! <xsl:param name="scoringTeam"/>
! <xsl:param name="conceedingTeam"/>
! <xsl:param name="conceedingTeamID"/>
! <xsl:for-each
! select="//event[type='teamStarter' and team=$conceedingTeam] | //event[type='substituteStarter' and team=$conceedingTeam]">
! <xsl:variable name="playerFullName">
! <xsl:call-template name="getPlayerFullName">
! <xsl:with-param name="playerSurname">
! <xsl:value-of select="player" />
! </xsl:with-param>
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
! <xsl:choose>
! <xsl:when test="starts-with($scoringTeam, 'ERROR')">
! <error>
! <xsl:value-of
! select="concat('Unable to deduct conceeded goal points from ', $playerFullName, ' of ', $conceedingTeam, ' because cannot identify scoring team (', $scoringTeam, ')')" />
! </error>
! </xsl:when>
! <xsl:when test="starts-with($playerFullName, 'ERROR')">
! <error>
! <xsl:value-of
! select="concat('Unable to deduct goalkeepers/defenders conceeding points for ', $playerFullName, ' of ', $conceedingTeam)" />
! </error>
! </xsl:when>
! <xsl:otherwise>
<!-- get player start time -->
! <xsl:variable name="onMinutes">
! <xsl:choose>
<!-- if the player was a teamStarter then start time is 00:00 -->
! <xsl:when test="self::node()[type='teamStarter']">
! 00</xsl:when>
<!-- if player was a teamSubstitute and they were subbed on then start time is xx:xx -->
! <xsl:when
! test="//event[type='substitution' and playerOn=$playerFullName]">
! <xsl:value-of
! select="//event[type='substitution' and playerOn=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- otherwise the player did not play at all -->
! <xsl:otherwise>Did Not Play</xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
<!-- get stop time -->
! <xsl:variable name="offMinutes">
! <xsl:choose>
<!-- if the player was subbed off then their stop time is xx:xx -->
! <xsl:when
! test="//event[type='substitution' and playerOff=$playerFullName]">
! <xsl:value-of
! select="//event[type='substitution' and playerOff=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- if the player was sent off then their stop time is xx:xx -->
! <xsl:when
! test="//event[type='sendingOff' and player=$playerFullName]">
! <xsl:value-of
! select="//event[type='sendingOff' and player=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- otherwise the stop time was 90:00 -->
! <xsl:otherwise>90</xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
<!-- test to see if the player was on the pitch when the goal was scored -->
! <xsl:if test="$onMinutes != 'Did Not Play'">
! <xsl:if
! test="$goalMinutes < $offMinutes and $goalMinutes > $onMinutes">
! <xsl:variable name="playerPosition">
! <xsl:call-template name="getPlayerPosition">
! <xsl:with-param name="playerSurname">
! <xsl:value-of select="player" />
! </xsl:with-param>
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
! <xsl:choose>
! <xsl:when test="$playerPosition = 'Goalkeeper'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Goalkeeper Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Full Back'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Full Back Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Centre Back'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Centre Back Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Midfield'">
! </xsl:when>
! <xsl:when test="$playerPosition = 'Forward'">
! </xsl:when>
! <xsl:otherwise>
! <error>
! <xsl:value-of
! select="concat('Unable to determine player position to deduct conceeded goal points (', $playerFullName, ' of ', $conceedingTeam, ')')" />
! </error>
! </xsl:otherwise>
! </xsl:choose>
! </xsl:if>
</xsl:if>
! </xsl:otherwise>
! </xsl:choose>
! </xsl:for-each>
! </xsl:template>
!
<!-- Any player receiving a Yellow Card will lose 1 point for each time they receive a card (i.e. first offence -1 pt., second offence -1 pt. (total -2 pts.)). -->
<xsl:template name="yellowCards">
--- 466,662 ----
</xsl:call-template>
</xsl:variable>
!
<xsl:call-template name="deductDefenderPoints">
<xsl:with-param name="goalMinutes">
! <xsl:value-of select="$goalMinutes" />
</xsl:with-param>
+
<xsl:with-param name="scoringTeam">
! <xsl:value-of select="$scoringTeam" />
</xsl:with-param>
+
<xsl:with-param name="conceedingTeam">
! <xsl:value-of select="$conceedingTeam" />
</xsl:with-param>
+
<xsl:with-param name="conceedingTeamID">
! <xsl:value-of select="$conceedingTeamID" />
</xsl:with-param>
</xsl:call-template>
</xsl:for-each>
! </xsl:template>
!
<!-- Deduct points from defenders and goalkeepers who have conceeded a goal -->
! <xsl:template name="deductDefenderPoints">
! <xsl:param name="goalMinutes" />
! <xsl:param name="scoringTeam" />
! <xsl:param name="conceedingTeam" />
! <xsl:param name="conceedingTeamID" />
! <xsl:for-each
! select="//event[type='teamStarter' and team=$conceedingTeam] | //event[type='substituteStarter' and team=$conceedingTeam]">
! <xsl:variable name="playerFullName">
! <xsl:call-template name="getPlayerFullName">
! <xsl:with-param name="playerSurname">
! <xsl:value-of select="player" />
! </xsl:with-param>
!
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
!
! <xsl:choose>
! <xsl:when test="starts-with($scoringTeam, 'ERROR')">
! <error>
! <xsl:value-of
! select="concat('Unable to deduct conceeded goal points from ', $playerFullName, ' of ', $conceedingTeam, ' because cannot identify scoring team (', $scoringTeam, ')')" />
! </error>
! </xsl:when>
!
! <xsl:when test="starts-with($playerFullName, 'ERROR')">
! <error>
! <xsl:value-of
! select="concat('Unable to deduct goalkeepers/defenders conceeding points for ', $playerFullName, ' of ', $conceedingTeam)" />
! </error>
! </xsl:when>
!
! <xsl:otherwise>
<!-- get player start time -->
! <xsl:variable name="onMinutes">
! <xsl:choose>
<!-- if the player was a teamStarter then start time is 00:00 -->
! <xsl:when test="self::node()[type='teamStarter']">00</xsl:when>
<!-- if player was a teamSubstitute and they were subbed on then start time is xx:xx -->
! <xsl:when
! test="//event[type='substitution' and playerOn=$playerFullName]">
! <xsl:value-of
! select="//event[type='substitution' and playerOn=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- otherwise the player did not play at all -->
! <xsl:otherwise>Did Not Play</xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
<!-- get stop time -->
! <xsl:variable name="offMinutes">
! <xsl:choose>
<!-- if the player was subbed off then their stop time is xx:xx -->
! <xsl:when
! test="//event[type='substitution' and playerOff=$playerFullName]">
! <xsl:value-of
! select="//event[type='substitution' and playerOff=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- if the player was sent off then their stop time is xx:xx -->
! <xsl:when
! test="//event[type='sendingOff' and player=$playerFullName]">
! <xsl:value-of
! select="//event[type='sendingOff' and player=$playerFullName]/normalTimeMinutes" />
! </xsl:when>
<!-- otherwise the stop time was 90:00 -->
! <xsl:otherwise>90</xsl:otherwise>
! </xsl:choose>
! </xsl:variable>
<!-- test to see if the player was on the pitch when the goal was scored -->
! <xsl:if test="$onMinutes != 'Did Not Play'">
! <xsl:if
! test="$goalMinutes < $offMinutes and $goalMinutes > $onMinutes">
! <xsl:variable name="playerPosition">
! <xsl:call-template name="getPlayerPosition">
! <xsl:with-param name="playerSurname">
! <xsl:value-of select="player" />
! </xsl:with-param>
! <xsl:with-param name="teamID">
! <xsl:value-of select="$conceedingTeamID" />
! </xsl:with-param>
! </xsl:call-template>
! </xsl:variable>
! <xsl:choose>
! <xsl:when test="$playerPosition = 'Goalkeeper'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Goalkeeper Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Full Back'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Full Back Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Centre Back'">
! <xsl:call-template name="getPointsNode">
! <xsl:with-param name="playerName">
! <xsl:value-of select="$playerFullName" />
! </xsl:with-param>
! <xsl:with-param name="playersTeam">
! <xsl:value-of select="$conceedingTeam" />
! </xsl:with-param>
! <xsl:with-param name="points">-1</xsl:with-param>
! <xsl:with-param name="eventType">Centre Back Conceeded
! Goal</xsl:with-param>
! </xsl:call-template>
! </xsl:when>
! <xsl:when test="$playerPosition = 'Midfield'">
! </xsl:when>
! <xsl:when test="$playerPosition = 'Forward'">
! </xsl:when>
! <xsl:otherwise>
! <error>
! <xsl:value-of
! select="concat('Unable to determine player position to deduct conceeded goal points (', $playerFullName, ' of ', $conceedingTeam, ')')" />
! </error>
! </xsl:otherwise>
! </xsl:choose>
</xsl:if>
! </xsl:if>
! </xsl:otherwise>
! </xsl:choose>
! </xsl:for-each>
! </xsl:template>
!
<!-- Any player receiving a Yellow Card will lose 1 point for each time they receive a card (i.e. first offence -1 pt., second offence -1 pt. (total -2 pts.)). -->
<xsl:template name="yellowCards">
***************
*** 756,759 ****
--- 765,769 ----
<xsl:template name="getPlayerPosition">
<xsl:param name="playerSurname" />
+
<xsl:param name="teamID" />
***************
*** 935,940 ****
<xsl:param name="playerName" />
- <xsl:param name="playersTeam" />
-
<xsl:param name="points" />
--- 945,948 ----
***************
*** 946,958 ****
</xsl:attribute>
- <xsl:attribute name="team">
- <xsl:value-of select="$playersTeam" />
- </xsl:attribute>
-
- <points>
- <xsl:value-of select="$points" />
- </points>
-
<event>
<type>
<xsl:value-of select="$eventType" />
--- 954,962 ----
</xsl:attribute>
<event>
+ <points>
+ <xsl:value-of select="$points" />
+ </points>
+
<type>
<xsl:value-of select="$eventType" />
Index: Scores2HTML.xsl
===================================================================
RCS file: /cvsroot/csms/csms-core/src/resources/conf/Scores2HTML.xsl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Scores2HTML.xsl 28 Oct 2002 13:54:22 -0000 1.1
--- Scores2HTML.xsl 10 Nov 2002 14:51:25 -0000 1.2
***************
*** 45,49 ****
<tr>
<td><xsl:value-of select="."/></td>
! <td><xsl:value-of select="sum(/scores/player[@name=$name]/points)"/></td>
</tr>
</xsl:template>
--- 45,49 ----
<tr>
<td><xsl:value-of select="."/></td>
! <td><xsl:value-of select="sum(/scores/player[@name=$name]/event/points)"/></td>
</tr>
</xsl:template>
***************
*** 59,63 ****
<th>Total</th>
<th>
! <xsl:value-of select="sum(/scores/player[@name=$name]/points)"/>
</th>
</tr>
--- 59,63 ----
<th>Total</th>
<th>
! <xsl:value-of select="sum(/scores/player[@name=$name]/event/points)"/>
</th>
</tr>
***************
*** 68,72 ****
<tr>
<td><xsl:value-of select="event/type"/></td>
! <td><xsl:value-of select="points"/></td>
</tr>
</xsl:template>
--- 68,72 ----
<tr>
<td><xsl:value-of select="event/type"/></td>
! <td><xsl:value-of select="event/points"/></td>
</tr>
</xsl:template>
|