summaryrefslogtreecommitdiff
path: root/Master/Tools/tpmfromcat.xsl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2005-12-28 00:04:28 +0000
committerKarl Berry <karl@freefriends.org>2005-12-28 00:04:28 +0000
commite6faeef3e4205722d36bbbb86b3b3390ab6527be (patch)
treeb6bf2abd8e881f40beaca430df2e1c34c02c19ab /Master/Tools/tpmfromcat.xsl
parent577983747d8680b8defbfdd03a9d50bad6fd54b7 (diff)
trunk
git-svn-id: svn://tug.org/texlive/trunk@5 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/Tools/tpmfromcat.xsl')
-rw-r--r--Master/Tools/tpmfromcat.xsl81
1 files changed, 81 insertions, 0 deletions
diff --git a/Master/Tools/tpmfromcat.xsl b/Master/Tools/tpmfromcat.xsl
new file mode 100644
index 00000000000..4276721c9c2
--- /dev/null
+++ b/Master/Tools/tpmfromcat.xsl
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:TPM="http://texlive.dante.de/"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ exclude-result-prefixes="rdf TPM"
+ version="1.0">
+
+<xsl:output
+ method="xml"
+ indent="yes"
+ doctype-system="../../Tools/tpm.dtd"
+ />
+
+<xsl:param name="sarovar"/>
+<xsl:param name="authors"/>
+
+<xsl:template match="@*|processing-instruction()|comment()|text()" >
+ <xsl:copy/>
+</xsl:template>
+
+<xsl:template match="*" >
+ <xsl:copy>
+ <xsl:apply-templates
+ select="*|@*|processing-instruction()|comment()|text()" />
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="TPM:Description">
+ <xsl:variable name="S">
+ <xsl:value-of select="document($sarovar)/entry/description"/>
+ </xsl:variable>
+ <TPM:Description>
+ <xsl:choose>
+ <xsl:when test="$S=''">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$S"/>
+ [description copied from TeX Catalogue]
+ </xsl:otherwise>
+ </xsl:choose>
+ </TPM:Description>
+</xsl:template>
+
+<xsl:template match="TPM:Title">
+ <xsl:variable name="S">
+ <xsl:value-of select="document($sarovar)/entry/caption"/>
+ </xsl:variable>
+ <TPM:Title>
+ <xsl:choose>
+ <xsl:when test="$S=''">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$S"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </TPM:Title>
+</xsl:template>
+
+<xsl:template match="TPM:Author">
+ <xsl:variable name="A">
+ <xsl:value-of select="document($sarovar)/entry/authorref/@id"/>
+ </xsl:variable>
+ <xsl:variable name="S">
+ <xsl:value-of select="document($authors)/authors/author[@id=$A]"/>
+ </xsl:variable>
+ <TPM:Author>
+ <xsl:choose>
+ <xsl:when test="$S=''">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$S"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </TPM:Author>
+</xsl:template>
+
+</xsl:stylesheet>