<?xml version="1.0" encoding="UTF-8"?>
<!-- This file defines the variables for the dynamic dropdown tables of contents.
     Note the javascript methods on <select>, which simply pass the target URL to the form.
     David Sewell, 11 October 2011
-->
<xsl:stylesheet version="2.0" exclude-result-prefixes="tei"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0">
   <xsl:variable name="linearForm">
      <form name="optionForm">
         <select
            onchange="this.form.action=this.options[this.selectedIndex].value; this.form.submit();" style="font-family:Times New Roman;">
            <optgroup label="&#160;">
               <option value="#">SELECT A CHAPTER OR POEM</option>
               <option value="../CountreyParson/CPch1.html">CP I: Of a Pastor</option>
               <option value="../CountreyParson/CPch22.html">CP XXII: The Parson in Sacraments</option>
               <option value="../CountreyParson/CPch32.html">CP XXXII: The Parson’s Surveys</option>
               <option value="../OutlandishProverbs/op101-150.html">Outlandish Proverbs 101-150</option>
               <option value="../Letters/letters2.html">Letters II (To Sir J[ohn] D[anvers])</option>
               <option value="../Lucus/lucus25.html">Lucus XXV</option>
               <option value="../Lucus/lucus32.html">Lucus XXXII</option>
               <option value="../MusaeResponsoriae/mr33.html">Musae Responsoriae XXXIII</option>
               <option value="../MemoriaeMatrisSacrum/mms17.html">Memoriae Matris Sacrum XVII</option>
               <option value="../Temple/britishChurch.html">The British Church</option>
               <option value="../Temple/collar.html">The Collar</option>
               <option value="../Temple/flowre.html">The Flowre</option>
               <option value="../Temple/wreath.html">A Wreath</option>
               <option value="../OtherEnglishPoems/queenBohemia.html">To the Queene of Bohemia</option>
               <option value="../Will/will.html">Herbert’s Will</option>
            </optgroup>
         </select>
         <!--<input type="submit"/>-->
      </form>
   </xsl:variable>

   <xsl:template match="option" mode="options">
      <xsl:param name="URL" tunnel="yes"/>
      <xsl:copy>
         <xsl:apply-templates select="@*" mode="options"/>
         <xsl:if test="$URL = @value">
            <xsl:attribute name="selected">selected</xsl:attribute>
         </xsl:if>
         <xsl:apply-templates select="node()" mode="options"/>
      </xsl:copy>
   </xsl:template>

   <xsl:template match="node() | @*" mode="options">
      <xsl:copy>
         <xsl:apply-templates select="node() | @*" mode="options"/>
      </xsl:copy>
   </xsl:template>


</xsl:stylesheet>
