source: trunk/surname_id.xsl @ 76

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

replace single quote by underscore in author id to avoid warning in docbook 5 validation

  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1<?xml version="1.0" encoding="iso-8859-1"?>
2<xsl:stylesheet
3version="1.0"
4xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
6<!--
7module :
8génération de la partie "nom" de l'id
9
10update :
11$Id$
12fplod 2008-05-05T12:13:12Z aedon.locean-ipsl.upmc.fr (Darwin)
13simplification and replace single quote by underscore
14fplod 2007-05-18T13:03:39Z aedon.locean-ipsl.upmc.fr (Darwin)
15creation
16cf http://www.dpawson.co.uk/xsl/sect2/N7998.html
17There's a trick to this:
18
19translate($x, translate($x, 'abcde', ''), '')
20
21will remove all characters except a,b,c,d, and e from your string $x.
22et String split into elements dans http://www.dpawson.co.uk/xsl/sect2/N7240.html
23http://www.dpawson.co.uk/xsl/sect2/N7240.html
24cf. http://www.dpawson.co.uk/xsl/sect2/N7240.html CRLF to BR
25-->
26
27<xsl:template name="surname_id">
28 <xsl:param name="surname"/>
29  <xsl:variable name="surname1">
30   <xsl:variable name="single-quote">'</xsl:variable>
31   <xsl:variable name="underscore">_</xsl:variable>
32   <xsl:value-of select="translate($surname,$single-quote,$underscore)"/>
33  </xsl:variable>
34  <xsl:value-of select="translate($surname1, 'abcdefghijklmnopqrstuvwxyz éèçàùëöñó', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_EECAUEONO')"/>
35
36</xsl:template>
37</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.