source: trunk/superbibmany02_xml.xsl

Last change on this file was 355, checked in by pinsard, 10 years ago

fix thanks to coding rules; typo; dupe empty lines

  • Property svn:keywords set to Id
File size: 6.2 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet
3xmlns:d="http://docbook.org/ns/docbook"
4xmlns:xl="http://www.w3.org/1999/xlink"
5xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6version="1.0">
7
8<!--rst
9
10.. _superbibmany02_xml.xsl:
11
12======================
13superbibmany02_xml.xsl
14======================
15
16DESCRIPTION
17===========
18
19produce one DocBook 5 with a form containing bibliograhy references and general
20information of one author/user
21
22this DocBook will be chuncked for html output
23
24TODO
25====
26
27EVOLUTIONS
28==========
29
30$Id$
31
32- fplod 20110629T135204Z cratos.locean-ipsl.upmc.fr (Linux)
33
34  * authorgroup is found in main.xml
35
36- fplod 2008-09-17T10:40:43Z aedon.locean-ipsl.upmc.fr (Darwin)
37
38  * project name from main.xml file instead of a fixed one
39
40- fplod 2008-04-30T14:52:55Z aedon.locean-ipsl.upmc.fr (Darwin)
41
42  * language inherited from biblio.xml
43
44- fplod 2008-04-30T06:44:31Z aedon.locean-ipsl.upmc.fr (Darwin)
45
46  * chgt for dbk5 in
47
48- fplod 2007-10-17T08:06:40Z aedon.locean-ipsl.upmc.fr (Darwin)
49
50  * improve sort (diacriticals)
51
52- fplod 2007-05-18T14:59:29Z aedon.locean-ipsl.upmc.fr (Darwin)
53
54  * modif gestion id
55
56- fplod 2007-05-16T15:28:56Z aedon.locean-ipsl.upmc.fr (Darwin)
57
58  * correction pour homonymes partiels
59
60- fplod 2007-05-15T15:07:37Z aedon.locean-ipsl.upmc.fr (Darwin)
61
62  * modification to see user/userid="template" information if author_id
63    doesn't exit in users datafile
64
65- fplod 2007-04-16T08:10:06Z aedon.locean-ipsl.upmc.fr (Darwin)
66
67  * creation
68
69-->
70
71<xsl:output
72 method="xml"
73 indent="yes"
74 encoding="ISO-8859-1"
75 omit-xml-declaration="yes"/>
76
77<xsl:include href="firstname_id.xsl"/>
78<xsl:include href="surname_id.xsl"/>
79<xsl:include href="table_authors.xsl"/>
80<xsl:include href="form_db.xsl"/>
81
82<xsl:variable name="list_author_ids" select="///d:author[not( self::node() = following::d:author )]"/>
83
84<xsl:variable name="project">
85 <xsl:value-of select="document('main.xml')//d:keyword[@xml:id='project']"/>
86</xsl:variable>
87
88<xsl:template match="d:bibliography">
89
90<xsl:element name="article">
91<xsl:attribute name="version">5.0</xsl:attribute>
92<xsl:attribute name="xmlns">http://docbook.org/ns/docbook</xsl:attribute>
93<xsl:attribute name="xml:lang"><xsl:value-of select="@xml:lang"/></xsl:attribute>
94<title><xsl:value-of select="$project"/> - Known users</title>
95<info>
96<authorgroup>
97<xsl:copy-of select="document('main.xml')//d:info/d:authorgroup"/>
98</authorgroup>
99<keywordset>
100<keyword><xsl:value-of select="$project"/></keyword>
101</keywordset>
102<!-- ++ date -->
103</info>
104<sect1 xml:id="intro">
105<title>Intro</title>
106 <xsl:element name="para">
107These pages intent to provide an form for every known user of <xsl:value-of select="$project"/> with bibliography and information.
108 </xsl:element>
109<xsl:element name="para">
110   The mail sent by filling these forms will be used to update
111<link xl:href="../../one/main.php"><xsl:value-of select="$project"/>-Publications-Papers</link>
112and <link xl:href="../../one/user.html"><xsl:value-of select="$project"/> Users</link>.
113</xsl:element>
114
115<xsl:call-template name="para_lastupdate_bib">
116 <xsl:with-param name="language" select="@xml:lang"/>
117 <xsl:with-param name="date" select="d:info/d:date"/>
118 <xsl:with-param name="mode" select="'dbk'"/>
119</xsl:call-template>
120
121<xsl:call-template name="para_lastupdate_user">
122 <xsl:with-param name="language" select="@xml:lang"/>
123 <xsl:with-param name="date" select="document('user.xml')/users/date"/>
124 <xsl:with-param name="mode" select="'dbk'"/>
125</xsl:call-template>
126
127<xsl:call-template name="table_authors">
128 <xsl:with-param name="linktype" select="'external'"/>
129</xsl:call-template>
130
131</sect1>
132
133<!-- loop on author_ids -->
134<xsl:for-each select="$list_author_ids">
135 <xsl:sort order="ascending" data-type="text" select="translate(.,'abcdefghijklmnopqrstuvwxyz éèçàùëöñó', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_EECAUEONO')"/>
136 <xsl:variable name="author_id2">
137<xsl:call-template name="surname_id">
138 <xsl:with-param name="surname" select="d:personname/d:surname"/>
139</xsl:call-template>
140<xsl:text>_</xsl:text>
141<xsl:call-template name="firstname_id">
142 <xsl:with-param name="firstname" select="d:personname/d:firstname"/>
143</xsl:call-template>
144</xsl:variable>
145<!--
146<xsl:message terminate="no">
147 noeud courant <xsl:value-of select="name(.)"/>
148 author <xsl:value-of select="."/>
149 author_id2 <xsl:value-of select="$author_id2"/>
150</xsl:message>
151-->
152 <xsl:call-template name="one_author_id">
153  <xsl:with-param name="author_id" select="$author_id2"/>
154  <xsl:with-param name="author_name" select="."/>
155 </xsl:call-template>
156</xsl:for-each>
157
158</xsl:element>
159</xsl:template>
160
161<xsl:template match="d:info/d:date"/>
162<xsl:template match="d:bibliography/d:title"/>
163
164<xsl:template name="one_author_id">
165 <xsl:param name="author_id"/>
166 <xsl:param name="author_name"/>
167 <xsl:element name="sect1">
168  <xsl:attribute name="xml:id">
169   <xsl:value-of select="$author_id"/>
170  </xsl:attribute>
171  <xsl:element name="title">
172<xsl:value-of select="normalize-space($author_name/d:personname/d:firstname)"/><xsl:text> </xsl:text><xsl:value-of select="normalize-space($author_name/d:personname/d:surname)"/>
173  </xsl:element>
174  <xsl:element name="para">
175   The mail sent by filling this form will be used to update
176<link xl:href="../../one/main.php"><xsl:value-of select="$project"/> Publications-Papers</link>
177and <link xl:href="../../one/user.html"><xsl:value-of select="$project"/> Users</link>.
178  </xsl:element>
179
180  <xsl:choose>
181   <xsl:when test="document('user.xml')/users/user[descendant::userid=$author_id]/userid = $author_id">
182    <xsl:call-template name="form_db">
183     <xsl:with-param name="author_id" select="$author_id"/>
184     <xsl:with-param name="user" select="document('user.xml')/users/user[descendant::userid=$author_id]"/>
185     <xsl:with-param name="visu_modif" select="'modif'"/>
186     <xsl:with-param name="bibmode" select="'yes'"/>
187    </xsl:call-template>
188   </xsl:when>
189   <xsl:otherwise>
190    <xsl:call-template name="form_db">
191     <xsl:with-param name="author_id" select="$author_id"/>
192     <xsl:with-param name="user" select="document('user.xml')/users/user[descendant::userid='template']"/>
193     <xsl:with-param name="visu_modif" select="'modif'"/>
194     <xsl:with-param name="bibmode" select="'yes'"/>
195    </xsl:call-template>
196   </xsl:otherwise>
197  </xsl:choose>
198 </xsl:element>
199</xsl:template>
200
201</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.