<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html [
 <!ENTITY Egrave "&#200;">
 <!ENTITY egrave "&#232;">
 <!ENTITY agrave "&#224;">
 <!ENTITY ugrave "&#249;">
 <!ENTITY nbsp "&#160;">
 <!ENTITY copy "&#0169;">
 <!ENTITY laquo "&#0171;">
 <!ENTITY raquo "&#0187;">
]>

<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
  <xsl:param name="currpage" />
  <xsl:param name="language" />
  <xsl:param name="date" />

<xsl:template match="/">
  <xsl:apply-templates select="*/educationlist" />
  <xsl:apply-templates select="*/skilllist" />
  <xsl:apply-templates select="*/languagelist" />
  <xsl:apply-templates select="*/misclist" />
</xsl:template>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template match="educationlist">

  <a name="education"><xsl:text> </xsl:text></a>
  
  <xsl:choose>
    <xsl:when test="$language = 'it-IT'">

      <div class="post">
          <h2 class="title"> educazione e studi</h2>
          <div class="entry">
            <table class="wtable">
             <xsl:for-each select="education">
               <tr>
                 <td class="tblfield">Periodo:</td>
                 <td class="tbldata">da <xsl:apply-templates select="period/from"/> a <xsl:apply-templates select="period/to"/></td>
               </tr>
               <tr>
                 <td class="tblfield">Titolo:</td>
                 <td class="tbldata"><strong><xsl:value-of select="title"/></strong></td>
               </tr>
               <tr>
                 <td class="tblfield">Competenze:</td>
                 <td class="tbldata">
                   <xsl:call-template name="add-line-breaks"><xsl:with-param name="string" select="skills"/></xsl:call-template>
<!--
                   <a title="Show/Hide" href="javascript:toggleDisplay('d_educationlist')"><img src="/_images/btn.plus.gif" id="d_educationlistbtn" alt="+"/> Visualizza/Nascondi Compentenze</a>
                   <div id="d_educationlist" style="display: none;">
                   </div>
-->
                 </td>
               </tr>
               <tr>
                 <td class="tblfield">Organizzazione:</td>
                 <td class="tbldata"><xsl:call-template name="add-line-breaks"><xsl:with-param name="string" select="organisation"/></xsl:call-template></td>
               </tr>
               <tr>
                 <td class="tblfield">Livello:</td>
                 <td class="tbldata"><xsl:value-of select="level"/></td>
               </tr>
              <xsl:if test="position() &lt; last()">
               <tr>
                 <td colspan="2"><div class="separator"><xsl:text> </xsl:text></div></td>
               </tr>
              </xsl:if>
             </xsl:for-each>
            </table>
          </div>
          <div class="meta">
            <p class="byline">Aggiornato il <xsl:call-template name="render-date"><xsl:with-param name="date" select="$date"/></xsl:call-template>, Alessandro Polo</p>
            <p class="links"><a href="/curriculum/alessandro.polo.cv.it.html#competenze" class="more">versione stampa</a> <b>|</b> <a href="/curriculum/alessandro.polo.cv.it.pdf" class="comments">versione PDF</a></p>
          </div>
        </div>

    </xsl:when>
    <xsl:otherwise>

      <div class="post">
          <h2 class="title"> education and training</h2>
          <div class="entry">
            <table class="wtable">
             <xsl:for-each select="education">
               <tr>
                 <td class="tblfield">Date:</td>
                 <td class="tbldata">from <xsl:apply-templates select="period/from"/> to <xsl:apply-templates select="period/to"/></td>
               </tr>
               <tr>
                 <td class="tblfield">Title:</td>
                 <td class="tbldata"><strong><xsl:value-of select="title"/></strong></td>
               </tr>
               <tr>
                 <td class="tblfield">Skills:</td>
                 <td class="tbldata"><xsl:call-template name="add-line-breaks"><xsl:with-param name="string" select="skills"/></xsl:call-template>
                 </td>
               </tr>
               <tr>
                 <td class="tblfield">Organisation:</td>
                 <td class="tbldata"><xsl:call-template name="add-line-breaks"><xsl:with-param name="string" select="organisation"/></xsl:call-template></td>
               </tr>
               <tr>
                 <td class="tblfield">Level:</td>
                 <td class="tbldata"><xsl:value-of select="level"/></td>
               </tr>
              <xsl:if test="position() &lt; last()">
               <tr>
                 <td colspan="2"><div class="separator"><xsl:text> </xsl:text></div></td>
               </tr>
              </xsl:if>
             </xsl:for-each>
            </table>
          </div>
          <div class="meta">
            <p class="byline">Updated on <xsl:call-template name="render-date"><xsl:with-param name="date" select="$date"/></xsl:call-template>, Alessandro Polo</p>
            <p class="links"><a href="/curriculum/alessandro.polo.cv.en.html#skills" class="more">printer friendly</a> <b>|</b> <a href="/curriculum/alessandro.polo.cv.en.pdf" class="comments">PDF format</a></p>
          </div>
        </div>

    </xsl:otherwise>
  </xsl:choose>

</xsl:template>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template match="skilllist">

  <a name="competences"><xsl:text> </xsl:text></a>

  <xsl:choose>
    <xsl:when test="$language = 'it-IT'">
       <div class="post">
         <h2 class="title"> capacit&#224; personali e competenze</h2>
         <div class="entry">
           <table class="wtable"><xsl:for-each select="skill"><xsl:call-template name="skill_template"/></xsl:for-each></table>
         </div>
          <div class="meta">
            <p class="byline">Aggiornato il <xsl:call-template name="render-date"><xsl:with-param name="date" select="$date"/></xsl:call-template>, Alessandro Polo</p>
            <p class="links"><a href="/curriculum/alessandro.polo.cv.it.html" class="more">versione stampa</a> <b>|</b> <a href="/curriculum/alessandro.polo.cv.it.pdf" class="comments">PDF format</a></p>
          </div>
       </div>
    </xsl:when>
    <xsl:otherwise>
       <div class="post">
         <h2 class="title"> personal skills and competences</h2>
         <div class="entry">
           <table class="wtable"><xsl:for-each select="skill"><xsl:call-template name="skill_template"/></xsl:for-each></table>
         </div>
          <div class="meta">
            <p class="byline">Updated on <xsl:call-template name="render-date"><xsl:with-param name="date" select="$date"/></xsl:call-template>, Alessandro Polo</p>
            <p class="links"><a href="/curriculum/alessandro.polo.cv.en.html" class="more">printer friendly</a> <b>|</b> <a href="/curriculum/alessandro.polo.cv.en.pdf" class="comments">PDF format</a></p>
          </div>
       </div>
    </xsl:otherwise>
  </xsl:choose>

</xsl:template>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template match="misclist">

  <a name="misc"><xsl:text> </xsl:text></a>
  
  <xsl:choose>
    <xsl:when test="$language = 'it-IT'">
       <div class="post">
         <h2 class="title"> varie</h2>
         <div class="entry">
           <table class="wtable"><xsl:for-each select="misc"><xsl:call-template name="skill_template"/></xsl:for-each></table>
         </div>
          <div class="meta">
            <p class="byline">Aggiornato il <xsl:call-template name="render-date"><xsl:with-param name="date" select="$date"/></xsl:call-template>, Alessandro Polo</p>
            <p class="links"><a href="/curriculum/alessandro.polo.cv.it.html" class="more">versione stampa</a> <b>|</b> <a href="/curriculum/alessandro.polo.cv.it.pdf" class="comments">PDF format</a></p>
          </div>
       </div>
    </xsl:when>
    <xsl:otherwise>
       <div class="post">
         <h2 class="title"> misc</h2>
         <div class="entry">
           <table class="wtable"><xsl:for-each select="misc"><xsl:call-template name="skill_template"/></xsl:for-each></table>
         </div>
          <div class="meta">
            <p class="byline">Updated on <xsl:call-template name="render-date"><xsl:with-param name="date" select="$date"/></xsl:call-template>, Alessandro Polo</p>
            <p class="links"><a href="/curriculum/alessandro.polo.cv.en.html" class="more">printer friendly</a> <b>|</b> <a href="/curriculum/alessandro.polo.cv.en.pdf" class="comments">PDF format</a></p>
          </div>
       </div>
    </xsl:otherwise>
  </xsl:choose>

</xsl:template>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template match="languagelist">

  <a name="languages"><xsl:text> </xsl:text></a>
  
  <xsl:choose>
    <xsl:when test="$language = 'it-IT'">
       <div class="post">
         <h2 class="title"> lingue</h2>
         <div class="entry">
           <table class="wtable"><xsl:for-each select="language"><xsl:apply-templates select="." /></xsl:for-each></table>
         </div>
          <div class="meta">
            <p class="byline">Aggiornato il <xsl:call-template name="render-date"><xsl:with-param name="date" select="$date"/></xsl:call-template>, Alessandro Polo</p>
            <p class="links"><a href="/curriculum/alessandro.polo.cv.it.html" class="more">versione stampa</a> <b>|</b> <a href="/curriculum/alessandro.polo.cv.it.pdf" class="comments">PDF format</a></p>
          </div>
       </div>
    </xsl:when>
    <xsl:otherwise>
       <div class="post">
         <h2 class="title"> languages</h2>
         <div class="entry">
            <table class="wtable"><xsl:for-each select="language"><xsl:apply-templates select="." /></xsl:for-each></table>
         </div>
          <div class="meta">
            <p class="byline">Updated on <xsl:call-template name="render-date"><xsl:with-param name="date" select="$date"/></xsl:call-template>, Alessandro Polo</p>
            <p class="links"><a href="/curriculum/alessandro.polo.cv.en.html" class="more">printer friendly</a> <b>|</b> <a href="/curriculum/alessandro.polo.cv.en.pdf" class="comments">PDF format</a></p>
          </div>
       </div>
    </xsl:otherwise>
  </xsl:choose>
  
</xsl:template>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template name="skill_template">

    <tr>
      <td class="tblfield"><xsl:value-of select="@type"/>:</td>
      <td class="tbldata"><xsl:call-template name="add-line-breaks"><xsl:with-param name="string" select="."/></xsl:call-template></td>
    </tr>

</xsl:template>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template match="language">

  <tr>
     <td class="tblfield"><xsl:value-of select="@type"/>:</td>
     <td class="tbldata">
       <strong><xsl:value-of select="label"/> [<xsl:value-of select="code"/>]</strong>
       <xsl:if test="level">
         <br/>
         <xsl:apply-templates select="level"/>
       </xsl:if>
     </td>
  </tr>

</xsl:template>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template match="level">
  <table style="margin-left: 2px; padding-left: 14px; border-left: dashed 1px #ccc;">
    <tr>
      <td class="tblfield">listening:</td>
      <td class="tbldata"><xsl:value-of select="listening"/></td>
    </tr>
    <tr>
      <td class="tblfield">reading:</td>
      <td class="tbldata"><xsl:value-of select="reading"/></td>
    </tr>
    <tr>
      <td class="tblfield">spokeninteraction:</td>
      <td class="tbldata"><xsl:value-of select="spokeninteraction"/></td>
    </tr>
    <tr>
      <td class="tblfield">spokenproduction:</td>
      <td class="tbldata"><xsl:value-of select="spokenproduction"/></td>
    </tr>
    <tr>
      <td class="tblfield">writing:</td>
      <td class="tbldata"><xsl:value-of select="writing"/></td>
    </tr>
  </table>
</xsl:template>




<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template name="render-date">
   <xsl:param name="date" />

   <xsl:if test="not (substring($date, 9, 1) = '0')">
    <xsl:value-of select="substring($date, 9, 1)" />
   </xsl:if>
   <xsl:value-of select="substring($date, 10, 1)" />
   <xsl:text> </xsl:text>

  <xsl:choose>
    <xsl:when test="$language = 'it-IT'">
      <xsl:choose>
        <xsl:when test="substring($date, 6, 2) = '01'">Gennaio</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '02'">Febbraio</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '03'">Marzo</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '04'">Aprile</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '05'">Maggio</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '06'">Giugno</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '07'">Luglio</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '08'">Agosto</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '09'">Settembre</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '10'">Ottobre</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '11'">Novembre</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '12'">Dicembre</xsl:when>
      </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="substring($date, 6, 2) = '01'">January</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '02'">February</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '03'">March</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '04'">April</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '05'">May</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '06'">June</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '07'">July</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '08'">August</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '09'">September</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '10'">October</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '11'">November</xsl:when>
        <xsl:when test="substring($date, 6, 2) = '12'">December</xsl:when>
      </xsl:choose>
    </xsl:otherwise>
   </xsl:choose>

   <xsl:text> </xsl:text>
   <xsl:value-of select="substring($date, 1, 4)" />

</xsl:template>


<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->


<xsl:template name="add-line-breaks">
   <xsl:param name="string" />

   <xsl:choose>
      <xsl:when test="contains($string, '&#xD;')">
         <xsl:value-of select="substring-before($string, '&#xD;')" />
         <br />
         <xsl:call-template name="add-line-breaks">
            <xsl:with-param name="string"
                            select="substring-after($string, '&#xD;')" />
         </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
         <xsl:value-of select="$string" />
      </xsl:otherwise>
   </xsl:choose>
</xsl:template>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<xsl:template match="period/from | period/to">

  <xsl:choose>
    <xsl:when test="year and not(year='')">
      <xsl:value-of select="year"/>
      <xsl:if test="month and not(month='')">-<xsl:value-of select="month"/>
      <xsl:if test="day and not(day='')">-<xsl:value-of select="day"/></xsl:if>
      </xsl:if>
    </xsl:when>
    <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="$language='it-IT'">
          Attualmente Attivo (titolo non conseguito)
        </xsl:when>
        <xsl:otherwise>
          Currently Active (not completed jet)
        </xsl:otherwise>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>

</xsl:template>



<xsl:template match="anchor">
  <a name="{.}">&nbsp;<xsl:text> </xsl:text></a>
</xsl:template>


<xsl:template match="para">

  <xsl:element name="p">
    <xsl:for-each select="@*">
      <xsl:attribute name="{name()}"><xsl:value-of select="."/></xsl:attribute>
    </xsl:for-each>
    <xsl:apply-templates/>
  </xsl:element>

</xsl:template>



<xsl:template match="unorderedlist">
  <ul>
    <xsl:for-each select="listitem">
       <li><xsl:apply-templates /></li>
    </xsl:for-each>
  </ul>
</xsl:template>

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


<xsl:template match="@*|a|img|br|i" priority="-1">
  <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
</xsl:template>


<xsl:template match="text()">
  <xsl:value-of select="."/>
<!--      <xsl:value-of select="normalize-space()"/>    -->
</xsl:template>

<!--

<xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
  <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
</xsl:template>

<xsl:template match="@*|node()" priority="-1">
  <xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy>
</xsl:template>
-->


</xsl:stylesheet>

