<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

	<!-- this sets the selected tab -->

    <xsl:variable name="tab">
        <xsl:choose>
            <xsl:when test="$area = 'dashboard'">
                <xsl:text>dashboard</xsl:text>
            </xsl:when>
            <xsl:when test="$area = 'report' and ($cmd = 'list' or $cmd = 'show')">
                <xsl:text>report</xsl:text>
            </xsl:when>
            <xsl:when test="$area = 'reports' or $app = 'reports'">
                <xsl:text>sales</xsl:text>
            </xsl:when>
            <xsl:when test="$area = 'tracker' or $area = 'matcher'">
                <xsl:text>royalties</xsl:text>
            </xsl:when>
            <xsl:when test="$area = 'catalog' or $area = 'master' or $area = 'song' or $area = 'track' or $area = 'product' or $area = 'license' or $area = 'ca_license' or $area = 'distribution' or ($area = 'uk_mech' and ($cmd = 'edit_mcps_license' or $cmd = 'show_mcps_license'))">
                <xsl:text>catalog</xsl:text>
            </xsl:when>
            <xsl:when test="$area = 'payee' or $area = 'publisher' or $area = 'ca_publisher' or $area = 'label_payee' or $area = 'artist_payee'">
                <xsl:text>payee</xsl:text>
            </xsl:when>
            <xsl:when test="$area = 'contract' or $area = 'artist_contract' or $area = 'ccomp' or $area = 'label_contract'">
                <xsl:text>contract</xsl:text>
            </xsl:when>
            <xsl:when test="$area = 'label_royalty' or $area = 'report' or $area = 'mechanical' or $area = 'statement' or $area = 'artist_royalty' or $area = 'uk_mech' or $area = 'ca_mechanical' or ($area = 'display' and /Root/Params/d = 'statements') ">
                <xsl:text>statement</xsl:text>
            </xsl:when>
            <xsl:when test="($area = 'user' and $cmd != 'profile' and $cmd != 'view_terms' and $cmd != 'changepw' and $cmd != 'contact') or $area = 'artist_statement_settings' or $area = 'reference' or $area = 'label' or $area = 'jobqueue' or $area = 'joblog' or $area = 'permission' or $area = 'region' or $area = 'price' or $area = 'service' or $area = 'payor' or $area = 'locale' or ($area = 'display' and /Root/Params/d = 'config') or $area = 'mcps' or $area = 'mapface'">
                <xsl:text>config</xsl:text>
            </xsl:when>
        </xsl:choose>
    </xsl:variable>


    <xsl:template name="navigation">

        <xsl:call-template name="topNav" />
        <xsl:call-template name="subNav" />
        <xsl:if test="$tab = 'sales' and $accessDenied != 1 and normalize-space(Report)">
			<div id="subSubNavWrapper">
	            <xsl:call-template name="subSubNav" />
			</div>
        </xsl:if>
    </xsl:template>



    <xsl:template name="topNav">
		<div id="topNavWrapper">  
			<xsl:if test="$accessDenied != 1">
			
				<!-- tabs -->
			
	            <ul id="topNav">
	      
	      	    <!-- dashboard tab -->
	      
	            <xsl:if test="Access/rps/dashboard/show">
	                <li class="tab">
	                    <xsl:if test="$tab = 'dashboard'">
	                        <xsl:attribute name="id">navOn</xsl:attribute>
	                    </xsl:if>
	                    <a href="/rps/dashboard">Dashboard</a>
	                </li>
	            </xsl:if>
	        
	        <!-- revenue tab -->
	        
			<xsl:if test="Access/app/tracker/main">
		        <li class="tab">
	                <xsl:if test="$tab = 'royalties'">
	                    <xsl:attribute name="id">navOn</xsl:attribute>
	                </xsl:if>
				    <a href="/app/tracker">Revenue</a>
				</li>
			</xsl:if>
					
			<!-- catalog tab -->
					
	        <xsl:if test="Access/rps/catalog/main">
	          <li class="tab">
	            <xsl:if test="$tab = 'catalog'">
	              <xsl:attribute name="id">navOn</xsl:attribute>
	            </xsl:if>
	            <a href="/rps/catalog">Catalog</a>
	          </li>
	        </xsl:if>

	        <!-- payee tab -->
	        

			<xsl:if test="Access/rps/payee/main">
	            <li class="tab">
	                <xsl:if test="$tab = 'payee'">
	                    <xsl:attribute name="id">navOn</xsl:attribute>
	                </xsl:if>
	                <a href="/rps/payee">Payees</a>
	            </li>
			</xsl:if>     
	        
	        <!-- contract tab -->
	        
	        <xsl:choose>
		        <xsl:when test="Access/rps/artist_contract/main and Access/rps/label_contract/main">
		          <li class="tab">
		            <xsl:if test="$tab = 'contract'">
		              <xsl:attribute name="id">navOn</xsl:attribute>
		            </xsl:if>
		            <a href="/rps/contract">Contracts</a>
		          </li>
		        </xsl:when>
		        <xsl:when test="Access/rps/artist_contract/main">
		          <li class="tab">
		            <xsl:if test="$tab = 'contract'">
		              <xsl:attribute name="id">navOn</xsl:attribute>
		            </xsl:if>
		            <a href="/rps/artist_contract">Contracts</a>
		          </li>
		        </xsl:when>
		        <xsl:when test="Access/rps/label_contract/main">
		          <li class="tab">
		            <xsl:if test="$tab = 'contract'">
		              <xsl:attribute name="id">navOn</xsl:attribute>
		            </xsl:if>
		            <a href="/rps/label_contract">Contracts</a>
		          </li>
		        </xsl:when>
		     </xsl:choose> 
	        
	        <!-- statement tab -->
	        
	        <xsl:if test="Access/rps/statement/main">
	          <li class="tab">
	            <xsl:if test="$tab = 'statement'">
	              <xsl:attribute name="id">navOn</xsl:attribute>
	            </xsl:if>
	            <a href="/rps/statement">Statements</a>
	          </li>
	        </xsl:if>
	        
	        <!-- report tab -->
	        
			<xsl:if test="Access/rps/report/list">
	          <li class="tab">
	            <xsl:if test="$tab = 'report'">
	              <xsl:attribute name="id">navOn</xsl:attribute>
	            </xsl:if>
	            <a href="/rps/report">Reports</a>
	          </li>
			</xsl:if>

	        <!-- admin tab -->
	        
			<xsl:if test="Access/rps/reference/statrates or Access/admin/jobqueue/show or Access/rps/label/edit or Access/rps/payor/edit or Access/rps/price/edit or Access/rps/region/edit or Access/rps/service/edit or Access/rps/user/edit or Access/rps/mapface/main">
	          <li class="tab">
	            <xsl:if test="$tab = 'config'">
	              <xsl:attribute name="id">navOn</xsl:attribute>
	            </xsl:if>
	            <a href="/rps/display?d=config">Admin</a>
	          </li>
			</xsl:if>
					
			<!-- analytics tab -->
			
			<xsl:if test="Access/app/reports/m">
				<li class="tab blankTab">
					<a />
				</li>
		        <li class="tab">
	  	        <xsl:if test="$tab = 'sales'">
	    	        <xsl:attribute name="id">navOn</xsl:attribute>
	      	    </xsl:if>
		        <a>
	  	          <xsl:choose>
	    	          <xsl:when test="$tab = 'sales'">
	      	          <xsl:call-template name="argsLink">
	        	          <xsl:with-param name="skip">c</xsl:with-param>
	          	        <xsl:with-param name="skip2">product</xsl:with-param>
	            		    <xsl:with-param name="skip3">artist</xsl:with-param>
	                	  <xsl:with-param name="skip4">format</xsl:with-param>
		                  <xsl:with-param name="skip5">service</xsl:with-param>
	  	                <xsl:with-param name="baseURL">/app/reports?</xsl:with-param>
	    	            </xsl:call-template>
	      	        </xsl:when>
	        	      <xsl:otherwise>
	          	      <xsl:attribute name="href">/app/reports</xsl:attribute>
	            	  </xsl:otherwise>
		            </xsl:choose>
	  	          Analytics
				</a>
	    	    </li>
			</xsl:if>
					
	       </ul>
       
       </xsl:if>
     </div>
  </xsl:template>


  <xsl:template name="subNav">
    <div id="subNav">
    
		<xsl:if test="$accessDenied != 1">
	      <xsl:if test="$tab = 'sales'">
	        <xsl:call-template name="salesSubNav" />
	      </xsl:if>

	      <xsl:if test="$tab = 'statement'">
	      	<table>
	      		<tr>
	      			<td>
	        			<xsl:call-template name="statementSubNav" />
	        		</td>
	        	</tr>
	        </table>
	      </xsl:if>
	      
	      <xsl:if test="$tab = 'config'">
	      	<table id="adminSubNav">
	      		<tr>
	      			<td>	      	
	        			<xsl:call-template name="configSubNav" />
	        		</td>
	        	</tr>
	        </table>	        
	      </xsl:if>

      </xsl:if>

    </div>
  </xsl:template>


  <xsl:template name="salesSubNav">
    <ul id="salesSubNav">
      <li class="serviceLink">
        <xsl:if test="$view = 'ss' or $view = 's'">
          <xsl:attribute name="id">subNavOn</xsl:attribute>
        </xsl:if>
        <a>
          <xsl:call-template name="argsLink">
            <xsl:with-param name="skip">c</xsl:with-param>
            <xsl:with-param name="skip2">product</xsl:with-param>
            <xsl:with-param name="skip3">artist</xsl:with-param>
            <xsl:with-param name="skip4">format</xsl:with-param>
            <xsl:with-param name="skip5">service</xsl:with-param>
            <xsl:with-param name="baseURL">/app/reports?c=ss</xsl:with-param>
          </xsl:call-template>
          revenue by service
        </a>
      </li>
      <li class="formatLink">
        <xsl:if test="$view = 'fs' or $view = 'f'">
          <xsl:attribute name="id">subNavOn</xsl:attribute>
        </xsl:if>
        <a>
          <xsl:call-template name="argsLink">
            <xsl:with-param name="skip">c</xsl:with-param>
            <xsl:with-param name="skip2">product</xsl:with-param>
            <xsl:with-param name="skip3">artist</xsl:with-param>
            <xsl:with-param name="skip4">format</xsl:with-param>
            <xsl:with-param name="skip5">service</xsl:with-param>
            <xsl:with-param name="baseURL">/app/reports?c=fs</xsl:with-param>
          </xsl:call-template>
          revenue by format
        </a>
      </li>
      <li class="albumLink">
        <xsl:if test="$view = 'as' or $view = 'a'">
          <xsl:attribute name="id">subNavOn</xsl:attribute>
        </xsl:if>
        <a>
          <xsl:call-template name="argsLink">
            <xsl:with-param name="skip">c</xsl:with-param>
            <xsl:with-param name="skip2">product</xsl:with-param>
            <xsl:with-param name="skip3">artist</xsl:with-param>
            <xsl:with-param name="skip4">format</xsl:with-param>
            <xsl:with-param name="skip5">service</xsl:with-param>
            <xsl:with-param name="baseURL">/app/reports?c=as</xsl:with-param>
          </xsl:call-template>
          top albums
        </a>
      </li>
      <li class="trackLink">
        <xsl:if test="$view = 'ks' or $view = 'k'">
          <xsl:attribute name="id">subNavOn</xsl:attribute>
        </xsl:if>
        <a>
          <xsl:call-template name="argsLink">
            <xsl:with-param name="skip">c</xsl:with-param>
            <xsl:with-param name="skip2">product</xsl:with-param>
            <xsl:with-param name="skip3">artist</xsl:with-param>
            <xsl:with-param name="skip4">format</xsl:with-param>
            <xsl:with-param name="skip5">service</xsl:with-param>
            <xsl:with-param name="baseURL">/app/reports?c=ks</xsl:with-param>
          </xsl:call-template>
          top tracks
        </a>
      </li>
      <li class="artistLink">
        <xsl:if test="$view = 'rs' or $view = 'r'">
          <xsl:attribute name="id">subNavOn</xsl:attribute>
        </xsl:if>
        <a>
          <xsl:call-template name="argsLink">
            <xsl:with-param name="skip">c</xsl:with-param>
            <xsl:with-param name="skip2">product</xsl:with-param>
            <xsl:with-param name="skip3">artist</xsl:with-param>
            <xsl:with-param name="skip4">format</xsl:with-param>
            <xsl:with-param name="skip5">service</xsl:with-param>
            <xsl:with-param name="baseURL">/app/reports?c=rs</xsl:with-param>
          </xsl:call-template>
          top artists
        </a>
      </li>
    </ul>
    <xsl:call-template name="filterNav" />
  </xsl:template>

  <xsl:template name="filterNav">

    <ul id="filterNav">

    <xsl:if test="User/AccessLevel != 5">

      <xsl:if test="$labelCount &gt; 1">
        <li>
          <xsl:if test="$view = 'ls'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a>
            <xsl:call-template name="argsLink">
              <xsl:with-param name="skip">c</xsl:with-param>
              <xsl:with-param name="skip2">product</xsl:with-param>
              <xsl:with-param name="skip3">artist</xsl:with-param>
              <xsl:with-param name="skip4">format</xsl:with-param>
              <xsl:with-param name="skip5">service</xsl:with-param>
              <xsl:with-param name="baseURL">/app/reports?c=ls</xsl:with-param>
            </xsl:call-template>
            top labels
          </a>
        </li>
      </xsl:if>
      <xsl:if test="$labelCount &gt; 1 and $countryCount &gt; 1">
        <li class="filterNavDivider">|</li>
      </xsl:if>

      </xsl:if>

      <xsl:if test="$countryCount &gt; 1">
        <li>
          <xsl:if test="$view = 'gs'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a>
            <xsl:call-template name="argsLink">
              <xsl:with-param name="skip">c</xsl:with-param>
              <xsl:with-param name="skip2">product</xsl:with-param>
              <xsl:with-param name="skip3">artist</xsl:with-param>
              <xsl:with-param name="skip4">format</xsl:with-param>
              <xsl:with-param name="skip5">service</xsl:with-param>
              <!--<xsl:with-param name="skip6"><xsl:if test="/Root/Params/country != 'EU'">country</xsl:if></xsl:with-param>-->
              <xsl:with-param name="baseURL">/app/reports?c=gs</xsl:with-param>
            </xsl:call-template>
            countries</a>
        </li>
      </xsl:if>
    </ul>
  </xsl:template>

  <xsl:template name="statementSubNav">
    <ul id="statementSubNav">
      <xsl:if test="Access/rps/ca_mechanical/show = 1">
        <li>
          <xsl:if test="$area = 'ca_mechanical' or $cmd = 'show_ca_mechanical' or $cmd = 'ca_tracks_no_timings' or $cmd = 'ca_inactive_licenses' or $cmd = 'ca_license_overage' or $cmd = 'ca_tracks_no_licenses' or $cmd = 'ca_license_accrual' or $cmd = 'ca_publisher_mailing'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/ca_mechanical">CA Mechanicals</a>
        </li>
      </xsl:if>
      <xsl:if test="Access/rps/uk_mech/show = 1">
        <li>
          <xsl:if test="$area = 'uk_mech' or $cmd = 'show_uk_mechanical' or $cmd = 'uk_mech_unit_summary' or $cmd = 'uk_mech_current_retentions' or $cmd = 'uk_mech_negative_units' or $cmd = 'uk_mech_retention_summary' or $cmd = 'uk_mech_retention_run_summary' or $cmd = 'uk_mech_missed_sales'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/uk_mech">UK Mechanicals</a>
        </li>
      </xsl:if>     
      <xsl:if test="Access/rps/mechanical/show = 1">
        <li>
          <xsl:if test="$area = 'mechanical' or $cmd = 'show_mechanical' or $cmd = 'show_mechanical_pdf' or $cmd = 'tracks_no_timings' or $cmd = 'inactive_licenses' or $cmd = 'license_overage' or $cmd = 'tracks_no_licenses' or $cmd = 'license_accrual' or $cmd = 'publisher_mailing'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/mechanical">US Mechanicals</a>
        </li>
      </xsl:if>       
      <xsl:if test="Access/rps/artist_royalty/show = 1">
        <li>
          <xsl:if test="$area = 'artist_royalty' or $cmd = 'show_artist' or $cmd = 'albums_no_contracts' or $cmd = 'products_no_prices' or $cmd = 'missed_sales' or $cmd = 'payee_mailing' or $cmd = 'artist_reserve_pipeline'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/artist_royalty">Artist Royalties</a>
        </li>
      </xsl:if>
      <xsl:if test="Access/rps/statement/show_label = 1">
        <li>
          <xsl:if test="$area = 'label_royalty' or $cmd = 'show_label' or $cmd = 'labels_no_contracts' or $cmd = 'labels_multiple_contracts'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/label_royalty">Label Royalties</a>
        </li>
      </xsl:if>
    </ul>
  </xsl:template>

  <xsl:template name="configSubNav">
    <ul id="configSubNav">
	    <xsl:if test="Access/admin/jobqueue/show = 1">
    		<li>
    			<xsl:if test="$area = 'jobqueue' or $area = 'joblog'">
    				<xsl:attribute name="id">subNavOn</xsl:attribute>
    			</xsl:if>
    			<a href="/support/job_queue">Job Queue</a>
           	</li>
    	</xsl:if>
    	<xsl:if test="Access/rps/label/edit = 1">
			<li>
				<xsl:if test="$area = 'label'">
					<xsl:attribute name="id">subNavOn</xsl:attribute>
				</xsl:if>
				<a href="/rps/label">Labels</a>
           	</li>
    	</xsl:if>
		<xsl:if test="Access/admin/locale/show = 1">
			<li>
				<xsl:if test="$area = 'locale'">
					<xsl:attribute name="id">subNavOn</xsl:attribute>
				</xsl:if>
				<a href="/admin/locale?c=show">Locale</a>
           	</li>
		</xsl:if>			
        <xsl:if test="Access/rps/mapface/main = 1">
            <li>
                <xsl:if test="$area = 'mapface'">
                    <xsl:attribute name="id">subNavOn</xsl:attribute>
                </xsl:if>
                <a href="/rps/mapface">MapFace</a>
            </li>
        </xsl:if>			
		<xsl:if test="Access/admin/mcps/show = 1">
			<li>
				<xsl:if test="$area = 'mcps'">
					<xsl:attribute name="id">subNavOn</xsl:attribute>
				</xsl:if>
				<a href="/admin/mcps?c=show">MCPS</a>
           	</li>
		</xsl:if>			
        <xsl:if test="Access/rps/payor/edit = 1">
            <li>
              <xsl:if test="$area = 'payor'">
                <xsl:attribute name="id">subNavOn</xsl:attribute>
              </xsl:if>
              <a href="/rps/payor">Payors</a>
            </li>
		</xsl:if>
      <xsl:if test="Access/rps/price/edit = 1">
        <li>
          <xsl:if test="$area = 'price'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/price">Prices</a>
        </li>
      </xsl:if>
      <xsl:if test="Access/rps/region/edit = 1">
        <li>
          <xsl:if test="$area = 'region'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/region">Regions</a>
        </li>
      </xsl:if>
      <xsl:if test="Access/rps/service/edit = 1">
        <li>
          <xsl:if test="$area = 'service'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/service">Services</a>
        </li>
      </xsl:if>
      <xsl:if test="Access/rps/artist_statement_settings/edit = 1">
        <li>
          <xsl:if test="$area = 'artist_statement_settings'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/artist_statement_settings">Statements</a>
        </li>
      </xsl:if>
      <xsl:if test="Access/rps/reference/statrates = 1">
        <li>
          <xsl:if test="$area = 'reference' and $cmd = 'statrates'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/reference?c=statrates">Stat Rates</a>
        </li>
      </xsl:if>
	    <xsl:if test="Access/rps/user/edit = 1">
        <li>
          <xsl:if test="$area = 'user'">
            <xsl:attribute name="id">subNavOn</xsl:attribute>
          </xsl:if>
          <a href="/rps/user">Users</a>
        </li>
	    </xsl:if>
    </ul>
  </xsl:template>


  <xsl:template name="subSubNav">
    <div id="subSubNav">
      <form name="subNavChoices" onsubmit="navChange('{$view}','{$service}','{$format}','{$artist}','{Report/ProductInfo/ProductID}',this.country.value,this.period.value,this.label_id.value);return false" action="#">
        <label>now viewing: </label>
        <xsl:call-template name="labelNav" />
        <xsl:call-template name="countryNav" />
        <xsl:call-template name="periodNav" />
        <input type="submit" value="apply filter" />
        <input type="button" value="clear">
          <xsl:attribute name="onClick">
            location.href='?<xsl:if test="Params/c">c=<xsl:value-of select="Params/c" /></xsl:if><xsl:if test="Params/product">&amp;product=<xsl:value-of select="Params/product" /></xsl:if><xsl:if test="Params/format">&amp;format=<xsl:value-of select="Params/format" /></xsl:if><xsl:if test="Params/service">&amp;service=<xsl:value-of select="Params/service" /></xsl:if><xsl:if test="Params/artist">&amp;artist=<xsl:value-of select="Params/artist" /></xsl:if>'
          </xsl:attribute>
        </input>
      </form>
    </div>
  </xsl:template>


  <xsl:template name="labelNav">
    <xsl:choose>
      <xsl:when test="$labelCount &gt; 1">
        <select name="label_id">
        	<xsl:if test="User/AccessLevel != 5">
          	<option value="0">All Labels</option>
          </xsl:if>
          <xsl:for-each select="Report/Labels/Label">
            <option value="{LabelID}">
              <xsl:if test="LabelID = $labelID">
                <xsl:attribute name="selected">selected</xsl:attribute>
              </xsl:if>
              <xsl:value-of select="LabelNamePretty" />
            </option>
          </xsl:for-each>
        </select>
      </xsl:when>
      <xsl:otherwise>
        <input type="hidden" name="label_id" value="{$labelID}" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>


  <xsl:template name="countryNav">
    <xsl:choose>
      <xsl:when test="$countryCount &gt; 1">
        <select name="country">
          <option value="">All Countries</option>
            <xsl:for-each select="Report/Countries/Country">
              <option value="{Code}">
              <xsl:if test="Code = /Root/Params/country">
                <xsl:attribute name="selected">selected</xsl:attribute>
              </xsl:if>
              <xsl:value-of select="Name" />
            </option>
          </xsl:for-each>
        </select>
      </xsl:when>
      <xsl:otherwise>
        <input type="hidden" name="country" value="{$country}" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>


  <xsl:template name="periodNav">
    <xsl:variable name="currentPeriod"><xsl:value-of select="$periodType" /><xsl:value-of select="$period" /></xsl:variable>
    <select name="period">
    <xsl:for-each select="Report/PeriodNav/Year">
      <option value="{ID}">
      <xsl:if test="ID = $currentPeriod">
        <xsl:attribute name="selected">selected</xsl:attribute>
      </xsl:if>
      <xsl:value-of select="Year" /></option>
      <xsl:for-each select="Item">
        <option value="{ID}">
        <xsl:if test="ID = $currentPeriod">
          <xsl:attribute name="selected">selected</xsl:attribute>
        </xsl:if>
        &#160;&#160;&#160;&#160;<xsl:value-of select="Name" /></option>
      </xsl:for-each>
    </xsl:for-each>
    </select>
  </xsl:template>


</xsl:stylesheet>

