diff options
Diffstat (limited to 'packaging/templates.xsl')
-rw-r--r-- | packaging/templates.xsl | 64 |
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> <<xsl:for-each + select="/rpm-info/colophon/worker"><xsl:if test="@id = $who"><xsl:value-of + select="@email"/></xsl:if></xsl:for-each>></xsl:template> + + + +</xsl:stylesheet> |