<?xml version="1.0"?> 

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                version="1.0">

  <xsl:output method="html"
              version="4.0"
              doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"
              doctype-system="http://www.w3.org/TR/REC-html40/loose.dtd"
              encoding="ISO-8859-1"/>

  <xsl:strip-space elements="*"/>


<xsl:template match="SOUNDFILE">
	<APPLET MAYSCRIPT="" CODE="SoundApp.class" WIDTH="10" HEIGHT="10" NAME="player">
		<PARAM>
			<xsl:attribute name="NAME">Sound</xsl:attribute>
			<xsl:attribute name="VALUE"><xsl:value-of select="@href"/></xsl:attribute>
		</PARAM>
		<PARAM>
			<xsl:attribute name="NAME">IDS</xsl:attribute>
			<xsl:attribute name="VALUE">
		 		<xsl:for-each select="//*[./AUDIO]"><xsl:value-of select="generate-id(.)"/>,</xsl:for-each>
			</xsl:attribute>
		</PARAM>
		<PARAM>
			<xsl:attribute name="NAME">STARTS</xsl:attribute>
			<xsl:attribute name="VALUE">
		 		<xsl:for-each select="//AUDIO"><xsl:value-of select="@start"/>,</xsl:for-each>
			</xsl:attribute>
		</PARAM>
		<PARAM>
			<xsl:attribute name="NAME">ENDS</xsl:attribute>
			<xsl:attribute name="VALUE">
		 		<xsl:for-each select="//AUDIO"><xsl:value-of select="@end"/>,</xsl:for-each>
			</xsl:attribute>
		</PARAM>
	</APPLET>
</xsl:template>

<xsl:template match="/">
	<html><head></head>
	<SCRIPT language="Javascript" src="Scripts.js"/>
	<body bgColor="silver"><xsl:apply-templates/></body></html>
</xsl:template>  

<xsl:template match="titre">
	<div align="center">
	<br><font color="blue"><h1><xsl:apply-templates/></h1></font></br>
	</div>
</xsl:template> 

<xsl:template match="auteur">
	<div align="center">
	<br><i><h2><xsl:apply-templates/></h2></i></br>
	</div>
</xsl:template>

<xsl:template match="info_corpus">
	<br><i><xsl:apply-templates/></i></br>
</xsl:template> 

<xsl:template match="image">
<div align="center">
<IMG>
<xsl:attribute name="src">
<xsl:value-of select="image/@chemin"/>
</xsl:attribute>
</IMG>
</div>
</xsl:template> 

<xsl:template match="traduction">
	<br><xsl:apply-templates/></br>
</xsl:template> 

<xsl:template match="mot">
	<xsl:text> </xsl:text><xsl:apply-templates/>
</xsl:template> 

<xsl:template match="dialogue">
<br><b><i><font color="blue"><xsl:apply-templates select=".//traduction[@lang='francais']"/></font>
	  <font color="yellow"><xsl:apply-templates select=".//traduction[@lang='tcheque']"/></font></i></b></br>
</xsl:template> 

<xsl:template match="paragraphe">
	<b>
		<xsl:apply-templates select=".//phrase"/>
   	</b>
</xsl:template> 
<xsl:template match="phrase">
	<span>
		<xsl:attribute name="id"><xsl:value-of select="generate-id(.)"/></xsl:attribute>
		<xsl:attribute name="onclick">playFrom('<xsl:value-of select="generate-id(.)"/>')</xsl:attribute>
		<font color="blue"><xsl:apply-templates select=".//traduction[@lang='francais']"/></font>
		<font color="yellow"><xsl:apply-templates select=".//traduction[@lang='tcheque']"/></font>
	</span>
</xsl:template> 

<xsl:template match="mot[(text()='mouton') or (text()='beranek')]">
	<xsl:if test="./ancestor::phrase[@loc='narrateur']">
		<xsl:text> </xsl:text><b><font color="red"><xsl:apply-templates/></font></b>
		</xsl:if>
	</xsl:template>
  


</xsl:stylesheet>
