File: authors-subs.xsl

package info (click to toggle)
auto-multiple-choice 1.4.0-2~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,520 kB
  • sloc: perl: 23,839; xml: 20,920; cpp: 1,791; makefile: 472; ansic: 186; sh: 80
file content (59 lines) | stat: -rw-r--r-- 1,448 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="text" />

  <xsl:template name="contributor">
    <xsl:param name="role" />
    <xsl:for-each select="contributor[contains(@role, $role)]">
      <xsl:if test="position() != 1">
        <xsl:text>
</xsl:text>
      </xsl:if>
      <xsl:value-of select="."/>
    </xsl:for-each>
  </xsl:template>

  <xsl:template name="creator">
    <xsl:for-each select="creator">
      <xsl:if test="position() != 1">
        <xsl:text>
</xsl:text>
      </xsl:if>
      <xsl:value-of select="."/>
    </xsl:for-each>
  </xsl:template>

<xsl:template match="/amc-authors">

  <xsl:text>s|@/CREATORS/@|</xsl:text>
    <xsl:call-template name="creator"/>
    <xsl:text>|;
</xsl:text>

  <xsl:text>s|@/AUTHORS/@|</xsl:text>
    <xsl:call-template name="contributor">
      <xsl:with-param name="role" select="'author'"/>
    </xsl:call-template>
    <xsl:text>|;
</xsl:text>

  <xsl:text>s|@/TRANSLATORS/@|</xsl:text>
    <xsl:call-template name="contributor">
      <xsl:with-param name="role" select="'translator'"/>
    </xsl:call-template>
    <xsl:text>|;
</xsl:text>

  <xsl:text>s|@/DOCUMENTERS/@|</xsl:text>
    <xsl:call-template name="contributor">
      <xsl:with-param name="role" select="'documenter'"/>
    </xsl:call-template>
    <xsl:text>|;
</xsl:text>

</xsl:template>

</xsl:stylesheet>