<?xml version="1.0"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
	<xsl:output method="html"
     media-type="text/html"
     doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
     doctype-system="DTD/xhtml1-strict.dtd"
	 omit-xml-declaration = "yes"
     indent="yes"
     encoding="UTF-8"/>
	<xsl:template match="OI">
		
		<xsl:if test="
			(
				count(DescriptionsComplementaires/DetailDescriptionComplementaire/Description[@type = '16.02.49']) = 0
				or DescriptionsComplementaires/DetailDescriptionComplementaire/Description[@type = '16.02.49']/text() = ''
			)
			and
			(
				sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.214' or @type = '15.05.215' or @type = '15.05.216' or @type = '15.05.217']]/NbPrest) = 0 
				and sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.193']]/Distance) = 0
			)
			and
			(
				DescriptionsComplementaires/DetailDescriptionComplementaire/Description[@type = '16.02.67']/text() = ''
				or count(DescriptionsComplementaires/DetailDescriptionComplementaire/Description[@type = '16.02.67']) = 0
			)
			and
			(
				count(PrestationsLiees/DetailPrestationLiee[@sous_type_obt = '02.01.1003.01.01']) = 0 
				and count(PrestationsLiees/DetailPrestationLiee[@sous_type_obt = '02.01.1003.01.02']) = 0
			)
		">
			aucune information
		</xsl:if>

		<xsl:if test="DescriptionsComplementaires/DetailDescriptionComplementaire/Description[@type = '16.02.49']/text() != ''">
			<h4>Ouverture :</h4>
			<p>
				<xsl:apply-templates select="DescriptionsComplementaires/DetailDescriptionComplementaire/Description[@type = '16.02.49']/text()" />
			</p>
			<br />
		</xsl:if>
		<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.214' or @type = '15.05.215' or @type = '15.05.216' or @type = '15.05.217']]/NbPrest) > 0 or sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.193']]/Distance) > 0">
			<h4>Pistes de ski alpin :</h4>
			<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.214' or @type = '15.05.215' or @type = '15.05.216' or @type = '15.05.217']]/NbPrest) > 0">
				<div class="pistes">
					<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.214']]/NbPrest) > 0">
						<span><strong><xsl:value-of select="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.214']]/NbPrest)" /></strong></span><span class="piste p_verte"></span>
					</xsl:if>
					<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.215']]/NbPrest) > 0">
						<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.214']]/NbPrest) > 0">
							<span>,&amp;nbsp; </span>
						</xsl:if>
						<span><strong><xsl:value-of select="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.215']]/NbPrest)" /></strong></span><span class="piste p_bleue"></span>
					</xsl:if>
					<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.216']]/NbPrest) > 0">
						<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.214' or @type = '15.05.215']]/NbPrest) > 0">
							<span>,&amp;nbsp; </span>
						</xsl:if>
						<span><strong><xsl:value-of select="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.216']]/NbPrest)" /></strong></span><span class="piste p_rouge"></span>
					</xsl:if>
					<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.217']]/NbPrest) > 0">
						<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.214' or @type = '15.05.215' or @type = '15.05.216']]/NbPrest) > 0">
							<span>,&amp;nbsp; </span>
						</xsl:if>
						<span><strong><xsl:value-of select="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.217']]/NbPrest)" /></strong></span><span class="piste p_noire"></span>
					</xsl:if>
					<br />
				</div>
			</xsl:if>
			<xsl:if test="sum(OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.193']]/Distance) > 0">
				<p><strong><xsl:value-of select="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.193']]/Distance" /></strong> km de pistes de ski nordique</p>
				<br />
			</xsl:if>
			<br />
		</xsl:if>
		<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41'
				or Prestation/@type = '15.07.40']/NbPrest != ''
			or OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.156'
				or @type = '15.05.68'
				or @type = '15.05.28'
				or @type = '15.05.75'
				or @type = '15.05.32'
				or @type = '15.05.29']]
			or DublinCore/ControlledVocabulary[@code = '02.01.1003.02.18'
				or @code = '02.01.1003.02.26'
				or @code = '02.01.1003.02.29'
				or @code = '02.01.1003.02.03'
				or @code = '02.01.1003.02.28'
				or @code = '02.01.1003.02.30'
				or @code = '02.01.1003.02.31'
				or @code = '02.01.1003.02.13'
				or @code = '02.01.1003.02.24'
				or @code = '02.01.01.02.45'
				or @code = '02.01.1003.02.01'
				or @code = '02.01.1003.02.21'
				or @code = '02.01.1003.02.02']/@libelle != ''">
			<h4>Activités :</h4>
			<div>
				<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41'
					or Prestation/@type = '15.07.40']/NbPrest != ''">
					<div class="cb"><strong>Dans la station</strong><br/>
						<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41']/NbPrest != '' or OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41']/Distance != ''">
							<p>Sentiers raquettes balisés :
								<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41']/NbPrest != ''" >
									<strong><xsl:value-of select="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41']/NbPrest" /></strong>
									<xsl:choose>
										<xsl:when test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41']/NbPrest > 1">
											itinéraires
										</xsl:when>
										<xsl:otherwise>
											itinéraire
										</xsl:otherwise>
									</xsl:choose>
								</xsl:if>
								<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41']/Distance != ''" >
									<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41']/NbPrest != ''" >
										,
									</xsl:if>
									<strong><xsl:value-of select="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.41']/Distance" /></strong> km
								</xsl:if>
							</p>
						</xsl:if>
						<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.40']/NbPrest != '' or OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.40']/Distance != ''">
							<p> Sentiers piétons balisés :
								<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.40']/NbPrest != ''" >
									<strong><xsl:value-of select="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.40']/NbPrest" /></strong>
									<xsl:choose>
										<xsl:when test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.40']/NbPrest > 1">
											itinéraires
										</xsl:when>
										<xsl:otherwise>
											itinéraire
										</xsl:otherwise>
									</xsl:choose>
								</xsl:if>
								<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.40']/Distance != ''" >
									<xsl:if test="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.40']/NbPrest != ''" >
										,
									</xsl:if>
									<strong><xsl:value-of select="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation/@type = '15.07.40']/Distance" /></strong> km
								</xsl:if>
							</p>
						</xsl:if>
						<p>
							<xsl:for-each select="OffresPrestations/DetailOffrePrestation/DetailPrestation[Prestation[@type = '15.05.156'
								or @type = '15.05.68'
								or @type = '15.05.28'
								or @type = '15.05.75'
								or @type = '15.05.32'
								or @type = '15.05.29']]">
								<xsl:if test="position() > 1">
									,
								</xsl:if>
								<xsl:value-of select="Prestation/text()" />
								<xsl:if test="Prestation[@type = '15.05.32'
								or @type = '15.05.29'] and NbPrest != ''">
									(<xsl:value-of select="NbPrest" />)
								</xsl:if>
							</xsl:for-each>
						</p>
					</div>
				</xsl:if>
				<xsl:if test="DublinCore/ControlledVocabulary[@code = '02.01.1003.02.18'
							or @code = '02.01.1003.02.26'
							or @code = '02.01.1003.02.29'
							or @code = '02.01.1003.02.03'
							or @code = '02.01.1003.02.28'
							or @code = '02.01.1003.02.30'
							or @code = '02.01.1003.02.31'
							or @code = '02.01.1003.02.13'
							or @code = '02.01.1003.02.24'
							or @code = '02.01.01.02.45'
							or @code = '02.01.1003.02.01'
							or @code = '02.01.1003.02.21'
							or @code = '02.01.1003.02.02']/@libelle != ''">
					<div class="cb mgt10"><strong>Sur le domaine</strong><br/>
						<p>
							<xsl:for-each select="DublinCore/ControlledVocabulary[@code != '02.01.1003.01.01'
							or @code = '02.01.1003.01.02']">
								<xsl:sort select="@libelle"/>
								<xsl:if test="position() > 1">
									,
								</xsl:if>
								<xsl:value-of select="@libelle" />
							</xsl:for-each>
						</p>
					</div>
				</xsl:if>
			</div>
			<br />
		</xsl:if>
		<xsl:if test="DescriptionsComplementaires/DetailDescriptionComplementaire/Description[@type = '16.02.67'] != ''">
			<h4>Tarifs</h4>
			<p>
				<xsl:apply-templates select="DescriptionsComplementaires/DetailDescriptionComplementaire/Description[@type = '16.02.67']/text()"/>
			</p>
			<br />
			
		</xsl:if>
		<xsl:if test="count(PrestationsLiees/DetailPrestationLiee[@sous_type_obt = '02.01.1003.01.01']) > 0 or count(PrestationsLiees/DetailPrestationLiee[@sous_type_obt = '02.01.1003.01.02']) > 0">
			<h4>Domaine reliés</h4>
									<ul style="margin:0;padding:0;list-style-type:none;">
			<xsl:for-each select="PrestationsLiees/DetailPrestationLiee[@sous_type_obt = '02.01.1003.01.01']">
				<li>
					<a>
					<xsl:attribute name="href">
						../sitra/-144-1-
						<xsl:if test="position() = 1"><xsl:value-of select="$geo1" /></xsl:if>
						<xsl:if test="position() = 2"><xsl:value-of select="$geo2" /></xsl:if>
						<xsl:if test="position() = 3"><xsl:value-of select="$geo3" /></xsl:if>
						<xsl:if test="position() = 4"><xsl:value-of select="$geo4" /></xsl:if>
						.html?TypeOBT=STA
					</xsl:attribute>
						<xsl:value-of select="./@libelle"/>
					</a>
				</li>
			</xsl:for-each>
			</ul>
					</xsl:if>
	</xsl:template>
</xsl:stylesheet>

