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

	<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">
		<h1>Learning Theories Hypertext</h1>
		<hr width="30%" align="left"/>
			<xsl:apply-templates select="//titre"/>
		<hr width="30%" align="left"/>
		Les textes originaux se trouvent a l'adresse suivante: <a href="http://www.hfni.gsehd.gwu.edu/~tip/index.html">http://www.hfni.gsehd.gwu.edu/~tip/index.html</a>
		<br/>Copyright 1994-2000 Greg Kearsley (gkearsley@sprynet.com) http://home.sprynet.com/~gkearsley
		<hr width="30%" align="left"/>
		<a href="mailto:Patrick.Mendelsohn@tecfa.unige.ch"><i>Patrick Mendelsohn</i></a> (mise en page : <a href="mailto:Didier.Strasser@pse.unige.ch"><i>Didier Strasser</i></a>)
		</body></html>
	</xsl:template>

	<xsl:template match="titre">
  		<xsl:param name="appro"><xsl:value-of select="../approche"/></xsl:param>
  		
  		<xsl:param name="pos"><xsl:value-of select="position() - 1"/></xsl:param>
  			
  		<xsl:param name="approOld"><xsl:value-of select="//concept[position() = $pos]/entete/approche"/></xsl:param>
  		
		<xsl:if test="$appro != $approOld">
			<br/><h3>Theorical Approach: <xsl:value-of select="$appro"/></h3>
		</xsl:if>
		   <a href="concept-element.sxml?id={../../@idConc}">
              <xsl:apply-templates/>
               </a> <xsl:apply-templates select="../auteurs"/><br/><br/>
        <!-- Titre: <A href="testconcept.sxml?portal=enumere&amp;id={../../@idConc}">
              <xsl:apply-templates/> -->
	</xsl:template>
	
	<xsl:template match="auteurs">
		<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>
	</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:stylesheet>
