File: email.xsl

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (39 lines) | stat: -rw-r--r-- 1,063 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?xml version="1.0"?>

<!--
    Name:       email.xsl
    Purpose:    Create email address lookup.
    Author:     Mike Wetherell
    Copyright:  (c) 2007 Mike Wetherell
    Licence:    wxWindows licence

    Usage: xsltproc -html tools/email.xsl http://svn.wxwidgets.org/users.cgi \
            > config/include/wx-devs.xml
-->

<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

<xsl:param name="at"> -at- </xsl:param>

<xsl:output indent="yes"/>

<xsl:template match="/">
    <emaillookup>
        <xsl:apply-templates select="//table/tr">
            <xsl:sort select="normalize-space(td[1])"/>
        </xsl:apply-templates>
    </emaillookup>
</xsl:template>

<xsl:template match="tr">
    <xsl:variable name="id" select="normalize-space(td[1])"/>
    <xsl:variable name="email" select="normalize-space(td[3])"/>

    <xsl:if test="$id and not(contains($id, ' ')) and contains($email, $at)">
        <email id="{$id}">
            <xsl:value-of select="$email"/>
        </email>
    </xsl:if>
</xsl:template>

</xsl:transform>