source: trunk/surname_id.xsl

Last change on this file was 323, checked in by pinsard, 11 years ago

fix for XSL documentations

  • Property svn:keywords set to Id
File size: 1.3 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<!--rst
7
8.. _surname_id.xsl:
9
10==============
11surname_id.xsl
12==============
13
14DESCRIPTION
15===========
16
17génération de la partie "nom" de l'id
18
19EVOLUTIONS
20==========
21
22$Id$
23
24- fplod 2008-05-05T12:13:12Z aedon.locean-ipsl.upmc.fr (Darwin)
25
26  * simplification and replace single quote by underscore
27
28- fplod 2007-05-18T13:03:39Z aedon.locean-ipsl.upmc.fr (Darwin)
29
30  * creation
31    cf http://www.dpawson.co.uk/xsl/sect2/N7998.html
32    There's a trick to this::
33
34       translate($x, translate($x, 'abcde', ''), '')
35
36    will remove all characters except a,b,c,d, and e from your string $x.
37    et String split into elements dans http://www.dpawson.co.uk/xsl/sect2/N7240.html
38    http://www.dpawson.co.uk/xsl/sect2/N7240.html
39    cf. http://www.dpawson.co.uk/xsl/sect2/N7240.html CRLF to BR
40
41-->
42
43<xsl:template name="surname_id">
44 <xsl:param name="surname"/>
45  <xsl:variable name="surname1">
46   <xsl:variable name="single-quote">'</xsl:variable>
47   <xsl:variable name="underscore">_</xsl:variable>
48   <xsl:value-of select="translate($surname,$single-quote,$underscore)"/>
49  </xsl:variable>
50  <xsl:value-of select="translate($surname1, 'abcdefghijklmnopqrstuvwxyz éèçàùëöñó', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_EECAUEONO')"/>
51
52</xsl:template>
53</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.