summaryrefslogtreecommitdiffstats
path: root/app/dialogs/authors.xsl
blob: 322eb8dbe3651c5989c66db15a724c4928c62476 (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="UTF-8"?>

<!--  XSL transformation to create a header file from authors.xml  -->

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:dc="http://purl.org/dc/elements/1.1/">

  <xsl:output method="text" />

  <xsl:template name="recent-contributor">
    <xsl:param name="role" />
    <xsl:apply-templates select="dc:contributor[contains(@role, $role) and
                                 ((number(@last-active) >= 2             and
                                  number(substring-after(@last-active, &quot;.&quot;)) >= 8) or
                                  number(@last-active) >= 3)]" />
  </xsl:template>

  <xsl:template match="/dc:gimp-authors">
<xsl:text>
/* NOTE: This file is auto-generated from authors.xml, do not edit it. */

static const gchar * const creators[] =
{
</xsl:text>
  <xsl:apply-templates select="dc:creator" />
<xsl:text>  NULL
};
</xsl:text>

<xsl:text>
static const gchar * const maintainers[] =
{
</xsl:text>
  <xsl:apply-templates select="dc:maintainer" />
<xsl:text>  NULL
};
</xsl:text>

<xsl:text>
static const gchar * const authors[] =
{
</xsl:text>
  <xsl:apply-templates select="dc:creator" />
  <xsl:apply-templates select="dc:maintainer" />
  <xsl:call-template name="recent-contributor">
    <xsl:with-param name="role" select="'author'"/>
  </xsl:call-template>
<xsl:text>  NULL
};
</xsl:text>

<xsl:text>
static const gchar * const artists[] =
{
</xsl:text>
  <xsl:call-template name="recent-contributor">
    <xsl:with-param name="role" select="'artist'"/>
  </xsl:call-template>
<xsl:text>  NULL
};
</xsl:text>

<xsl:text>
static const gchar * const documenters[] =
{
</xsl:text>
  <xsl:call-template name="recent-contributor">
    <xsl:with-param name="role" select="'documenter'"/>
  </xsl:call-template>
<xsl:text>  NULL
};
</xsl:text>
  </xsl:template>

  <xsl:template match="dc:creator">  "<xsl:apply-templates />",
</xsl:template>
  <xsl:template match="dc:maintainer">  "<xsl:apply-templates />",
</xsl:template>
  <xsl:template match="dc:contributor">  "<xsl:apply-templates />",
</xsl:template>

</xsl:stylesheet>