<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:param name="id"/>

	<xsl:template match="fiches">
		<xsl:processing-instruction name="cocoon-format">type="text/html"
		</xsl:processing-instruction>

		<html><head><title>Learning Theories Hypertext</title></head>
		<body bgcolor="#FFFFFF">
			<xsl:apply-templates select="concept[@idConc=$id]"/>
			<a href="javascript:history.go(-1)">Revenir en arrière</a>
		</body></html>
	</xsl:template>

	<xsl:template match="concept">
			<xsl:apply-templates/><br/><hr width="50%" align="center"/>
	</xsl:template>

	<xsl:template match="entete">
			<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="titre">
			<h1><xsl:apply-templates/></h1>
	</xsl:template>

	<xsl:template match="approche">
			<h2>Theorical Approach: <xsl:apply-templates/></h2>
	</xsl:template>

	<xsl:template match="auteurs">
			<h2>Author(s):
		<xsl:if test="count(auteur)=1">
  			<xsl:apply-templates select="auteur" mode="unSeul"/>
		</xsl:if>
		
		<xsl:if test="count(auteur) &gt; 1">
  			<xsl:for-each select="auteur">
				<xsl:choose>
					<xsl:when test="position() != last()">
						<xsl:apply-templates select="nom" mode="PasDernier"/><xsl:apply-templates select="prenom" mode="PasDernier"/>
					</xsl:when>
					
					<xsl:otherwise>
						<xsl:apply-templates select="nom" mode="Dernier"/><xsl:apply-templates select="prenom" mode="Dernier"/>
					</xsl:otherwise>
				</xsl:choose>
  			</xsl:for-each>
		</xsl:if>
		
			</h2><hr width="30%" align="left"/>
	</xsl:template>

	<xsl:template match="auteur" mode="unSeul">
		<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="nom" mode="PasDernier">
		<xsl:text> </xsl:text><xsl:apply-templates/>,<xsl:text> </xsl:text>
	</xsl:template>

	<xsl:template match="nom" mode="Dernier">
		<xsl:param name="typenom">et al.</xsl:param>
		<xsl:param name="typenom2"><xsl:value-of select="../prenom"/></xsl:param>
		<xsl:choose>
			<xsl:when test="node() != $typenom and string-length($typenom2) > 0">
				<xsl:text> &#38; </xsl:text><xsl:apply-templates/>,
			</xsl:when>

			<xsl:when test="node() != $typenom and string-length($typenom2) = 0">
				<xsl:text> &#38; </xsl:text><xsl:apply-templates/>
			</xsl:when>
			
			<xsl:otherwise>
				<xsl:text> </xsl:text><xsl:apply-templates/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="prenom" mode="PasDernier">
		<xsl:apply-templates/><xsl:text>,</xsl:text>
	</xsl:template>
		
	<xsl:template match="prenom" mode="Dernier">
		<xsl:text> </xsl:text><xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="//para">
		<xsl:choose>
			<xsl:when test="lien/@href">
				<b>Related websites :</b><xsl:apply-templates/>
			</xsl:when>
			<xsl:otherwise>
				<p><xsl:apply-templates/></p>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="lien">
			<UL><p><xsl:number count="lien" level="single" format="1"/>. <a href="{@href}"><xsl:apply-templates/></a></p></UL>
	</xsl:template>

	<xsl:template match="link">
			<a href="{@href}"><xsl:apply-templates/></a>
	</xsl:template>

	<xsl:template match="overview">
			<h2>Overview:</h2><xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="scope-application">
			<h2>Scope-Application:</h2><xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="example">
			<h2>Examples:</h2><p><xsl:apply-templates/></p>
	</xsl:template>

	<xsl:template match="exemple-intro">
			<p><xsl:apply-templates/></p>
	</xsl:template>

	<xsl:template match="liste-exemple">
			<xsl:apply-templates/>
	</xsl:template>

	<xsl:template match="item">
			<UL><p><xsl:number count="item" level="multiple" format="1.a"/>. <xsl:apply-templates/></p></UL>
	</xsl:template>

	<xsl:template match="principles">
			<h2>Principles:</h2><p><xsl:apply-templates/></p>
	</xsl:template>

	<xsl:template match="principle">
			<UL><p><xsl:number count="principle" level="single" format="1"/>. <xsl:apply-templates/></p></UL>
	</xsl:template>

	<xsl:template match="liste-references">
			<h2>References:</h2><p><xsl:apply-templates/></p>
	</xsl:template>

	<xsl:template match="reference">
			<UL><p><xsl:number count="reference" level="single" format="1"/>. <xsl:apply-templates/></p></UL>
	</xsl:template>

</xsl:stylesheet>
