<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- ========================================== -->
<!-- Curriculum Vitae XSL File by Daniel Werner -->
<!-- intended to convert the XML file into HTML -->
<!-- mailto: werner@efrei.fr                    -->
<!-- ========================================== -->
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" >

<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes" encoding="ISO-8859-1" />

  <xsl:template match="*"/>

	<!-- File -->
	<xsl:template match="file">
		<xsl:apply-templates />	
  </xsl:template>
  
  <!-- Resume -->
  <xsl:template match="resume">
	<xsl:text disable-output-escaping="yes">
	    <![CDATA[
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
	    ]]>
	</xsl:text>        
	<html>
	<head>
	  <title><xsl:apply-templates select="name" mode="contact"/></title>
	  <link rel="STYLESHEET" type="text/css" href="style.css"/>
	  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"/>
   	  <META HTTP-EQUIV="Pragma" CONTENT="no-cache"/>
   	  <META NAME="Author" CONTENT="Daniel Werner"/>
   	  <META NAME="Description" CONTENT="CV de Daniel Werner, &#233;tudiant &#224; l&#39;EFREI (Ecole Française d&#39;Electronique et d&#39;Informatique)."/>
   	  <META NAME="keywords" CONTENT="WERNER Daniel, WERNER, Daniel, Dan, EFREI, cv"/>
	  <link REL="SHORTCUT ICON" HREF="img/dwarf.ico"/> 
	</head>        
        <body>
        	<a name="top"></a>
          <xsl:apply-templates />
          <div align="right"><a href="#top"><img src="img/top.gif" border="0"/></a></div>
        </body>
	     
    </html>

  </xsl:template>

  <!-- Section -->
  <xsl:template match="section">
    <xsl:if test="@showtitle='true'">
			<SPAN class="section"><xsl:value-of select="@title" /></SPAN> 
			<HR align="left" width="90%"/>	
    </xsl:if>
   	<xsl:apply-templates />
  </xsl:template>

  <!-- Contact Information -->
  <xsl:template match="contact">
  
    <TABLE width="90%" border="0">
      <tr>
 	<td width="50%">
          <SPAN class="title"><xsl:value-of select="name" mode="contact"/></SPAN>
          <SPAN class="text"> (<xsl:value-of select="age"/>)<br/>
		   	    <xsl:value-of select="born"/><xsl:value-of select="bornplace"/><br/>
		   	    <xsl:value-of select="nationalite"/><br/>
			  		<xsl:value-of select="situation"/> - <xsl:value-of select="permis"/><br/>   	    
          </SPAN>
          <br/>
          <SPAN class="text">
	    <xsl:apply-templates  select="address" mode="contact"/>
    	    	<img src="img/tel.gif"/> : <xsl:value-of select="portable" /><br/>
            <img src="img/mail.gif"/> email :
            <a><xsl:attribute name="href" >mailto:<xsl:value-of select="email"/></xsl:attribute><xsl:value-of select="email"/></a><br/>
            <img src="img/web.gif"/> web : 
            <a><xsl:attribute name="href" ><xsl:value-of select="site"/></xsl:attribute><xsl:value-of select="site"/></a><br/>
	  </SPAN>  
	</td>
 	<TD width="50%" align="right" valign="top">
 			<div class="mini"><xsl:value-of select="autreL"/></div>
  	  <A href="cv.php?choixlang=1"><IMG src="img/fr.gif" border="0" alt="cv en français" /></A>&#160;
  	  <A href="cv.php?choixlang=2"><img src="img/de.gif" border="0" alt="cv in deutsch"/></A>&#160;
  	  <A href="cv.php?choixlang=3"><img src="img/uk.gif" border="0" alt="cv in english"/></A>&#160;&#160;
  	  <br/><div class="mini"><xsl:value-of select="dwlCV"/></div>
  	  <A><xsl:attribute name="href" ><xsl:value-of select="pdflink"/></xsl:attribute><img border="0" alt="cv au format Acrobat Reader"><xsl:attribute name="src" ><xsl:value-of select="pdfimg"/></xsl:attribute></img></A>&#160;&#160;
  	  <img src="img/doc.gif" border="0" alt="cv au format Word"/>&#160;&#160;&#160;
 	</TD>
      </tr>
     </TABLE>	
  </xsl:template>

  <xsl:template match="name" mode="contact">
    	<xsl:value-of select="."/>
  </xsl:template>

  <xsl:template match="telephone">
    	<xsl:value-of select="."/>
  </xsl:template>
    
  <xsl:template match="age">
    	<xsl:value-of select="."/>
  </xsl:template>

  <xsl:template match="email">
        <xsl:value-of select="."/>
  </xsl:template>

  <xsl:template match="address" mode="contact">
    	<xsl:value-of select="concat(number, ', ')"/> 
        <xsl:value-of select="concat(street, ' ')"/><br/>
    	<xsl:value-of select="concat(zip-code, ' ')"/>
        <xsl:value-of select="concat(city, ' ')"/><br/>
  </xsl:template>

  <!-- Objective -->
  <xsl:template match="objective">
    <p class="objective">
     <xsl:value-of select="."/>
    </p>
  </xsl:template>

  <!-- Education -->
  <xsl:template match="education">
      <xsl:apply-templates select="degree"/>
  </xsl:template>
  
  <xsl:template match="degree">
	<BLOCKQUOTE class="text">
		<TABLE width="90%" border="0">
			<TBODY>
				<TR>
					<TD class="text" valign="top" width="20%">  
						<xsl:apply-templates select="date"/>
					</TD>
      		<TD class="text">
						<xsl:apply-templates select="institution"/> :
						<xsl:value-of select="longname"/><br/>
						<xsl:if test="oldname"><xsl:apply-templates select="oldname" mode="education"/><br/></xsl:if>
						<i>
							<xsl:apply-templates select="description" mode="education" />
							<xsl:apply-templates select="description2" mode="education" />
						</i>
      		</TD>
    		</TR>
   		</TBODY>
  	</TABLE>
 	</BLOCKQUOTE>    		
  </xsl:template>

  <xsl:template match="description" mode="education">
      <xsl:value-of select="."/><br/>
  </xsl:template>
  
  <xsl:template match="description2" mode="education">
      <xsl:value-of select="."/><br/>
  </xsl:template>

  <xsl:template match="date">
      <xsl:value-of select="concat(@day, ' ')"/>
      <xsl:value-of select="concat(@month, ' ')"/>
      <xsl:value-of select="@year"/>
  </xsl:template>

  <xsl:template match="institution">
		<a><xsl:attribute name="href" ><xsl:value-of select="site"/></xsl:attribute>
			<B><xsl:value-of select="name"/></B></a>,       
    <xsl:apply-templates select="address"/> 
  </xsl:template>

  <xsl:template match="address">
      <xsl:value-of select="concat(number, ' ')"/>
      <xsl:value-of select="concat(street, ' ')"/>
      <xsl:value-of select="concat(zip-code, ' ')"/>
      <xsl:value-of select="concat(city, ' ')"/>
      <xsl:value-of select="country"/>
  </xsl:template> 

	<!-- Languages -->
  <xsl:template match="languages">
      <xsl:apply-templates select="language"/>
  </xsl:template>
 
  <xsl:template match="language">
 		<BLOCKQUOTE class="text">
  		<TABLE width="90%" border="0">
    		<TBODY>
    			<TR>
      			<TD class="text" valign="top" width="20%">
      				<xsl:value-of select="langue"/>
						</TD>
      			<TD class="text">
      				<xsl:apply-templates select="desc" mode="languages"/>
						</TD>
    			</TR>
   			</TBODY>
  		</TABLE>
 		</BLOCKQUOTE>      				
  </xsl:template>
  
 	<xsl:template match="desc" mode="languages">
 		<xsl:if test="@onWEB='true'">
			<xsl:apply-templates />
		</xsl:if>
	</xsl:template>
	
	<!-- Languages Diplomas -->
  <xsl:template match="diplomes">
   		<DIV class="text"><B>Diplômes :</B></DIV>
      <xsl:apply-templates select="diplome"/>
  </xsl:template>
 
  <xsl:template match="diplome">
 			<BLOCKQUOTE>
  		 <TABLE width="100%" border="0">
   			 <TBODY>
   			  <TR>
    			  <TD class="text" valign="top" width="20%">
      				<xsl:value-of select="date"/>
      			</TD>
      			<TD class="text">
        			<a><xsl:attribute name="href" ><xsl:value-of select="urlLieu"/></xsl:attribute><xsl:value-of select="lieu"/></a>,
        			<xsl:value-of select="ville"/> :
							<a><xsl:attribute name="href" ><xsl:value-of select="url"/></xsl:attribute><b><xsl:value-of select="name"/></b></a> ¤ 
							<xsl:value-of select="result"/><br/>
							<i><xsl:value-of select="longname"/></i>
						</TD>
    			</TR>
   			</TBODY>
  		</TABLE>
 		</BLOCKQUOTE>      				
  </xsl:template>

  <!-- Skills -->
  <xsl:template match="skillset">
      <xsl:apply-templates select="skill" />
  </xsl:template>
  
  <xsl:template match="skill">
		<BLOCKQUOTE class="text">
  		<TABLE width="90%" border="0">
    		<TBODY>
    			<TR>
      			<TD class="text" valign="top" width="20%">  
							<xsl:value-of select="name" />
						</TD>
      			<TD class="text">
							<xsl:apply-templates select="skillDescription"/>       				
						</TD>
    			</TR>      
   			</TBODY>
  		</TABLE>
 		</BLOCKQUOTE>
	</xsl:template>
	
	<xsl:template match="skillDescription">
		<xsl:apply-templates />
  </xsl:template>
    
  <!-- Professional Experience -->
  <xsl:template match="employment-history">
      <xsl:apply-templates select="experience"/>
  </xsl:template>
  
  <xsl:template match="experience">
	<BLOCKQUOTE class="text">
  	<TABLE width="95%" border="0">
    	<TBODY>
	    	<TR>
	      	<TD class="text" valign="top" width="20%">  
	      		<xsl:apply-templates select="period"/>
	      	</TD>
	      	<TD class="text">
	      		<xsl:if test="title">
	      			<b><xsl:value-of select="title"/></b> - 
	      		</xsl:if>
	      		<xsl:if test="duree">
	      			<xsl:value-of select="duree"/><br/>
						</xsl:if>
			      <xsl:apply-templates select="employer"/>
			      <xsl:apply-templates select="expDesc"/> 
	      	</TD>
	    	</TR>
   		</TBODY>
  	</TABLE>
 	</BLOCKQUOTE>
	</xsl:template>
  
  <xsl:template match="period">
		<xsl:value-of select="concat(start-date/@month, ' ')"/>
		<xsl:value-of select="start-date/@year"/>
		<xsl:if test="end-date">
			<br/><xsl:value-of select="to"/>
			<xsl:value-of select="concat(' ', end-date/@month)"/>
			<xsl:value-of select="concat(' ', end-date/@year)"/>
		</xsl:if>
  </xsl:template> 
  
  <xsl:template match="employer">
		<a><xsl:attribute name="href" ><xsl:value-of select="homepage"/></xsl:attribute>
			<B><SPAN class="smallcaps"><xsl:value-of select="name"/></SPAN></B>
		</a>
		(<xsl:apply-templates select="address"/>) - <xsl:value-of select="detailSociete"/><br/>
  </xsl:template>

  <xsl:template match="expDesc">
		<xsl:if test="departement">
 			<xsl:value-of select="departement" />.
		</xsl:if>  
 		<xsl:apply-templates select="short-description" />
		<xsl:if test="captureURL">
			<br/>
    	(<a><xsl:attribute name="href" ><xsl:value-of select="captureURL" /></xsl:attribute><b><xsl:value-of select="capture" /></b></a>) 
    </xsl:if>
  </xsl:template>
  
  <xsl:template match="short-description">
    <xsl:apply-templates select="statement" />
  </xsl:template>

  <xsl:template match="statement">
    <fo:block>
      <i><xsl:value-of select="." /></i>
    </fo:block>
  </xsl:template>  
    
  <!-- Projects -->
  <xsl:template match="projects">
      <xsl:apply-templates select="project" />
  </xsl:template>
  
  <xsl:template match="project">
    <BLOCKQUOTE class="text">
  		<TABLE width="90%" border="0">
    		<TBODY>
    			<TR>
      			<TD class="text" valign="top" width="20%">
          		<xsl:apply-templates select="date"/>
          	</TD>
      			<TD class="text">
 							<xsl:choose>
								<xsl:when test="url">
									<a><xsl:attribute name="href" ><xsl:value-of select="url"/></xsl:attribute>
										<b><xsl:value-of select="projName"/></b><br/>
									</a>
								</xsl:when>
								<xsl:otherwise>
									<b><xsl:value-of select="projName"/></b><br/>
								</xsl:otherwise>
							</xsl:choose>
							<xsl:if test="projDesc"><xsl:value-of select="projDesc"/><br/></xsl:if>
							<xsl:if test="projTools"><xsl:apply-templates select="projTools"/><br/></xsl:if>
							<xsl:if test="projTeam"><i><xsl:value-of select="projTeam"/></i></xsl:if>
      			</TD>          	
    			</TR>
    		</TBODY>
   		</TABLE>
  	</BLOCKQUOTE>
  </xsl:template>
  
  <xsl:template match="projTools">
    <fo:block>
			<xsl:apply-templates />
    </fo:block>
  </xsl:template>

  <!-- Centres D'interet -->
  <xsl:template match="loisirs">
      <xsl:apply-templates select="loisir" />
  </xsl:template>
  
  <xsl:template match="loisir">
    <BLOCKQUOTE class="text">
  		<TABLE width="100%" border="0">
    		<TBODY>
    			<TR>
      			<TD class="text" valign="top" width="18%">
          		<xsl:value-of select="domaine"/>
          	</TD>
      			<TD class="text">
							<xsl:apply-templates select="enumLoisir"/>
      			</TD>          	
    			</TR>
    		</TBODY>
   		</TABLE>
  	</BLOCKQUOTE>
  </xsl:template>

  <xsl:template match="enumLoisir">
    <fo:block>
			<xsl:apply-templates /><br/>
    </fo:block>
  </xsl:template>

  <!-- Divers balises.. -->
  <xsl:template match="bolded">
    <b>
      <xsl:value-of select="."/>   
    </b>
  </xsl:template>

  <xsl:template match="italik">
		<i>
      <xsl:value-of select="."/>   
    </i>
  </xsl:template>

  <xsl:template match="lien">
			<a><xsl:attribute name="href" ><xsl:value-of select="@ici"/></xsl:attribute>
				<xsl:value-of select="."/>
			</a>
  </xsl:template>  

  <xsl:template match="latex">
		<xsl:choose>
			<xsl:when test="latex != 'LaTeX'">
				<xsl:value-of select="." />
			</xsl:when>
			<xsl:otherwise>
				L<sup>A</sup>T<sub>E</sub>X					
			</xsl:otherwise>						
		</xsl:choose>   
  </xsl:template>
  	
	<xsl:template match="curadress">
		<xsl:value-of select="." />
	</xsl:template>
	
	<xsl:template match="permadress">
		<xsl:value-of select="." />
	</xsl:template>
	
</xsl:stylesheet>
