source: trunk/table_authors.xsl @ 57

Last change on this file since 57 was 56, checked in by pinsard, 16 years ago

migration to docbook5 for biblio.xml; bug fix in bibopa.sh; xmlto is not anymore needed; xml(starlet) must be available

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