source: trunk/table_authors.xsl @ 53

Last change on this file since 53 was 49, checked in by pinsard, 16 years ago

improvements of .xsl files headers

  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
4<!--
5module :
6creation of a table with every author with an associated external or internal link
7
8update :
9$Id$
10fplod 2007-10-17T07:48:19Z aedon.locean-ipsl.upmc.fr (Darwin)
11improve sort (diacriticals)
12fplod 2007-05-18T14:40:38Z aedon.locean-ipsl.upmc.fr (Darwin)
13modif gestion des id
14fplod 2007-05-16T15:01:39Z aedon.locean-ipsl.upmc.fr (Darwin)
15correction pour homonymes partiels
16fplod 2007-04-18T13:32:33Z aedon.locean-ipsl.upmc.fr (Darwin)
17creation
18-->
19
20<xsl:output
21 method="xml"
22 indent="yes"
23 encoding="ISO-8859-1"
24 omit-xml-declaration="no"
25 doctype-public="-//OASIS//DTD DocBook XML V4.5//EN"
26 doctype-system="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"/>
27
28<xsl:template name="table_authors">
29<xsl:param name="linktype"/>
30<!--
31creation of an informatable of 10 author_ids
32each entry of the table is a link #SURNAME_f
33-->
34
35<xsl:element name="informaltable">
36 <xsl:attribute name="id">author_ids</xsl:attribute>
37 <xsl:attribute name="summary">author_ids of publications</xsl:attribute>
38 <xsl:attribute name="width">80%</xsl:attribute>
39 <xsl:element name="tgroup">
40  <xsl:variable name="nb_cols" select="8"/>
41  <xsl:attribute name="cols"><xsl:value-of select="$nb_cols"/></xsl:attribute>
42  <xsl:attribute name="align">center</xsl:attribute>
43  <xsl:attribute name="colsep">1</xsl:attribute>
44  <xsl:attribute name="rowsep">1</xsl:attribute>
45  <xsl:element name="tbody">
46   <xsl:for-each select="///author[not( self::node() = following::author )]">
47    <xsl:sort order="ascending" data-type="text" select="translate(.,'abcdefghijklmnopqrstuvwxyz éèçàùëöñó', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_EECAUEONO')"/>
48    <xsl:if test="position() = 1 or position() mod $nb_cols = 1">
49     <xsl:text>&#xA;</xsl:text>
50     <xsl:comment> début de row <xsl:value-of select="position()"/></xsl:comment>
51      <xsl:text disable-output-escaping="yes">
52      <![CDATA[
53<row>
54]]>
55     </xsl:text>
56    </xsl:if>
57    <xsl:text>&#xA;</xsl:text>
58    <xsl:element name="entry">
59     <xsl:variable name="author_id">
60<xsl:call-template name="surname_id">
61 <xsl:with-param name="surname" select="personname/surname"/>
62</xsl:call-template>
63<xsl:text>_</xsl:text>
64<xsl:call-template name="firstname_id">
65 <xsl:with-param name="firstname" select="personname/firstname"/>
66</xsl:call-template>
67     </xsl:variable>
68     <xsl:text>&#xA;</xsl:text>
69     <xsl:element name="ulink">
70      <xsl:choose>
71       <xsl:when test="$linktype='internal'">
72        <xsl:attribute name="url"><xsl:text>#</xsl:text><xsl:value-of select="$author_id"/></xsl:attribute>
73       </xsl:when>
74       <xsl:when test="$linktype='external'">
75        <xsl:attribute name="url"><xsl:value-of select="concat($author_id,$html.ext)"/></xsl:attribute>
76       </xsl:when>
77       <xsl:otherwise>
78        <xsl:message terminate="yes">
79eee : unknown linktype = <xsl:value-of select="$linktype"/>
80        </xsl:message>
81       </xsl:otherwise>
82      </xsl:choose>
83<xsl:value-of select="normalize-space(.)"/>
84     </xsl:element>
85    </xsl:element>
86    <xsl:if test="position() mod $nb_cols = 0 or position()=last()">
87     <xsl:text>&#xA;</xsl:text>
88     <xsl:comment> fin de row <xsl:value-of select="position()"/></xsl:comment>
89     <xsl:text disable-output-escaping="yes">
90     <![CDATA[
91</row>
92]]>
93     </xsl:text>
94    </xsl:if>
95   </xsl:for-each>
96  </xsl:element>
97 </xsl:element>
98</xsl:element>
99</xsl:template>
100</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.