metadata.xsl 1.77 KB
Newer Older
1 2 3 4 5 6 7 8
<?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. -->

Martin's avatar
Martin committed
9
  <xsl:output method="text" encoding="utf-8"/>
10 11

  <xsl:template match="article/title">
12 13
    <xsl:text>InfoBegin
InfoKey: Title
14 15 16 17 18
InfoValue: </xsl:text><xsl:value-of select="."/><xsl:text>
</xsl:text>
  </xsl:template>

  <xsl:template match="article/subtitle">
19 20
    <xsl:text>InfoBegin
InfoKey: Subject
21 22 23 24 25 26 27 28 29 30 31 32 33 34
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">
35 36
    <xsl:text>InfoBegin
InfoKey: Keywords
37 38 39 40 41 42 43
InfoValue: </xsl:text>
    <xsl:apply-templates select="*"/>
    <xsl:text>
</xsl:text>
  </xsl:template>

  <xsl:template match="articleinfo">
44 45
    <xsl:text>InfoBegin
InfoKey: Author
46
InfoValue: </xsl:text><xsl:apply-templates select="copyright"/>
47 48 49 50 51 52 53 54 55 56
    <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>
57
    <xsl:apply-templates select="keywordset"/>
58 59
    <xsl:text>InfoBegin
InfoKey: Creator
60
InfoValue: docbook-xsl, xsltproc
61
InfoBegin
62
InfoKey: Producer
63
InfoValue: DBLaTeX
64 65 66 67 68 69 70
</xsl:text>
  </xsl:template>

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