]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mowgli/home/xsl/common.xsl
ocaml 3.09 transition
[helm.git] / helm / mowgli / home / xsl / common.xsl
index f33f8ea7040a272451460e7a31986ab35e419858..9381c2d20e07fe6e3a0566b766e6f9e96d3e9ee8 100644 (file)
 
 <xsl:template name="person-name">
   <xsl:param name="file" select="''"/>
+  <xsl:param name="form" select="'full'"/>
   <xsl:variable name="person" select="document(concat('../xml/people/',$file,'.xml'))/person"/>
-  <xsl:if test="$person/qualification">
+  <xsl:if test="$person/qualification and $form = 'full'">
    <xsl:value-of select="$person/qualification"/>
    <xsl:value-of select="' '"/>
   </xsl:if>
-  <xsl:value-of select="$person/name"/>
+  <xsl:choose>
+   <xsl:when test="$form = 'full'">
+    <xsl:value-of select="$person/name"/>
+   </xsl:when>
+   <xsl:otherwise>
+    <!-- Bug: just the first name is abbreviated. The others are ignored. -->
+    <xsl:value-of select="substring($person/name,1,1)"/>
+    <xsl:text>.</xsl:text>
+   </xsl:otherwise>
+  </xsl:choose>
   <xsl:value-of select="' '"/>
   <xsl:value-of select="$person/surname"/>
 </xsl:template>