summaryrefslogtreecommitdiffstats
path: root/packaging/templates.xsl
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2005-12-29 22:37:32 +0000
committerPaul W. Frields <stickster@gmail.com>2005-12-29 22:37:32 +0000
commite7a55bc0fad50b29b27c5287d75d4e92f9f66798 (patch)
tree096dbccbe7a0dcedf63a2977c005db522915f97d /packaging/templates.xsl
parent01d8b2b7b2df62c91f12369e9c578666438117bf (diff)
downloadfedora-doc-utils-e7a55bc0fad50b29b27c5287d75d4e92f9f66798.tar.gz
fedora-doc-utils-e7a55bc0fad50b29b27c5287d75d4e92f9f66798.tar.xz
fedora-doc-utils-e7a55bc0fad50b29b27c5287d75d4e92f9f66798.zip
Reduce redundancy, and create new, stupider pet tricks
Diffstat (limited to 'packaging/templates.xsl')
-rw-r--r--packaging/templates.xsl64
1 files changed, 64 insertions, 0 deletions
diff --git a/packaging/templates.xsl b/packaging/templates.xsl
new file mode 100644
index 0000000..811a52d
--- /dev/null
+++ b/packaging/templates.xsl
@@ -0,0 +1,64 @@
+<xsl:stylesheet version="1.0" xml:space="preserve" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <xsl:strip-space elements="*"/>
+
+ <!-- Print the translated title of a document for language $lang -->
+ <xsl:template name="get-title">
+ <xsl:for-each select="/rpm-info/titles/translation">
+ <xsl:choose>
+ <xsl:when test="@lang = $lang">
+ <xsl:value-of select="title"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Print the translated description of a document for language $lang -->
+ <xsl:template name="get-desc">
+ <xsl:for-each select="/rpm-info/titles/translation">
+ <xsl:choose>
+ <xsl:when test="@lang = $lang">
+ <xsl:value-of select="desc"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Print a hierarchical entry for a given worker with id $who -->
+ <xsl:template name="human">
+ <xsl:for-each select="/rpm-info/colophon/worker">
+ <xsl:if test="@id = $who">
+ <xsl:element name="surname">
+ <xsl:value-of select="@surname"/>
+ </xsl:element>
+ <xsl:element name="firstname">
+ <xsl:value-of select="@firstname"/>
+ </xsl:element>
+ <xsl:if test="@othername != ''">
+ <xsl:element name="othername">
+ <xsl:value-of select="@othername"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <!-- Print a full name for a given worker with id $who -->
+ <!-- DO NOT CHANGE SPACING! -->
+ <xsl:template name="personname"><xsl:for-each
+ select="/rpm-info/colophon/worker"><xsl:if test="@id = $who"><xsl:value-of
+ select="@firstname"/> <xsl:if test="@othername != ''"><xsl:value-of
+ select="@othername"/> </xsl:if><xsl:value-of
+ select="@surname"/></xsl:if></xsl:for-each></xsl:template>
+
+ <!-- Print a full name and email for a given worker with id $who -->
+ <!-- DO NOT CHANGE SPACING! -->
+ <xsl:template name="packager"><xsl:call-template
+ name="personname"><xsl:with-param name="who"
+ select="$who"/></xsl:call-template> &lt;<xsl:for-each
+ select="/rpm-info/colophon/worker"><xsl:if test="@id = $who"><xsl:value-of
+ select="@email"/></xsl:if></xsl:for-each>&gt;</xsl:template>
+
+
+
+</xsl:stylesheet>