<?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.0" 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:param name="render_links">true</xsl:param>
  <xsl:param name="element" />

<xsl:template match="/">

    <xsl:apply-templates />

</xsl:template>

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


<xsl:template match="projects | papers">

<xsl:for-each select="*[codename=$element]">
 <xsl:if test="count(links/url) > 0">

 <li>
  <xsl:choose>
    <xsl:when test="$language = 'it-IT'">
     <h2>related <strong>links</strong></h2>
    </xsl:when>
    <xsl:otherwise>
      <h2>related <strong>links</strong></h2>
    </xsl:otherwise>
  </xsl:choose>
  <ul>
   <xsl:for-each select="links/url">
     <li><a href="{.}" title="{.}">
      <xsl:choose>
        <xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
        <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
      </xsl:choose>
     </a></li>
   </xsl:for-each>
  </ul>
</li>

 </xsl:if>
</xsl:for-each>

</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:stylesheet>

