<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY f  "http://xmlns.4suite.org/ext">
  <!ENTITY fres "http://xmlns.4suite.org/reserved">
]>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:cext="http://xmlns.4suite.org/demos/cards"
  xmlns:exslt="http://exslt.org/common"
  xmlns:exslt-str="http://exslt.org/strings"
  xmlns:f="&f;"
  xmlns:fcore="http://xmlns.4suite.org/4ss/score"
  xmlns:fhttp="http://xmlns.4suite.org/4ss/http"
  xmlns:fres="&fres;"
  xmlns:xupdate="http://www.xmldb.org/xupdate"
  extension-element-prefixes="cext exslt exslt-str f fcore fhttp fres"
  exclude-result-prefixes="xupdate"
>

  <!--

    4Suite repository demo application: Cribbage

    Top-level variables and keys required by many stylesheets

    Copyright 2004 Fourthought, Inc. (USA)
    http://4suite.org/

  -->

  <xsl:key name='players' match='/cribbage/player-info/player' use='number(@ID)'/>

  <xsl:variable name='players'>
    <players>
      <xsl:copy-of select='/cribbage/player-info/player'/>
    </players>
  </xsl:variable>

  <xsl:variable name='initial-dealer' select='number(/cribbage/game-info/cur-dealer/@IDREF)'/>
  <xsl:variable name='initial-player' select='number(/cribbage/game-info/cur-player/@IDREF)'/>
  <xsl:variable name='initial-count' select='sum(/cribbage/game-info/cur-count/score)'/>

</xsl:stylesheet>
