source: trunk/table_authors.xsl @ 140

Last change on this file since 140 was 76, checked in by pinsard, 16 years ago

no more NEMO reference in XSL files; project information (name and home page are in main.xml

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