File: metadata.xsl

package info (click to toggle)
refcard 13.1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,284 kB
  • sloc: python: 189; makefile: 108; sh: 6
file content (70 lines) | stat: -rw-r--r-- 1,808 bytes parent folder | download | duplicates (5)
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
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:fo="http://www.w3.org/1999/XSL/Format"
		version="1.0">

  <!-- (C) 2008 W. Martin Borgert debacle@debian.org
       See COPYING for the license status of this software. -->

  <xsl:output method="text" encoding="utf-8"/>

  <xsl:template match="article/title">
    <xsl:text>InfoBegin
InfoKey: Title
InfoValue: </xsl:text><xsl:value-of select="."/><xsl:text>
</xsl:text>
  </xsl:template>

  <xsl:template match="article/subtitle">
    <xsl:text>InfoBegin
InfoKey: Subject
InfoValue: </xsl:text><xsl:value-of select="."/><xsl:text>
</xsl:text>
  </xsl:template>

  <xsl:template match="keyword[@role]"/>

  <xsl:template match="keyword">
    <xsl:if test="position() != 1">
      <xsl:text>, </xsl:text>
    </xsl:if>
    <xsl:value-of select="."/>
  </xsl:template>

  <xsl:template match="keywordset">
    <xsl:text>InfoBegin
InfoKey: Keywords
InfoValue: </xsl:text>
    <xsl:apply-templates select="*"/>
    <xsl:text>
</xsl:text>
  </xsl:template>

  <xsl:template match="articleinfo">
    <xsl:text>InfoBegin
InfoKey: Author
InfoValue: </xsl:text><xsl:apply-templates select="copyright"/>
    <xsl:for-each select="copyright/holder">
      <xsl:value-of select="normalize-space(.)"/>
      <xsl:if test="position() != last()">
	<xsl:text>, </xsl:text>
      </xsl:if>
      <xsl:if test="position() = last()">
	<xsl:text>
</xsl:text>
      </xsl:if>
    </xsl:for-each>
    <xsl:apply-templates select="keywordset"/>
    <xsl:text>InfoBegin
InfoKey: Creator
InfoValue: docbook-xsl, xsltproc
InfoBegin
InfoKey: Producer
InfoValue: DBLaTeX
</xsl:text>
  </xsl:template>

  <xsl:template match="*|@*|text()">
    <xsl:apply-templates select="*|@*|text()"/>
  </xsl:template>
</xsl:stylesheet>