diff options
author | Karl Berry <karl@freefriends.org> | 2006-02-13 00:49:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-02-13 00:49:47 +0000 |
commit | 045f872c421bb96d9e680ccd7f79c823cef10521 (patch) | |
tree | 20483574ec8846ce1adb25e905f4a0b4e2505a41 /Build/tools/tpmfromcat.xsl | |
parent | a1e47d103e66e2a947105dd7378e8df3918c3f62 (diff) |
move Master/Tools to Build/tools
git-svn-id: svn://tug.org/texlive/trunk@1514 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/tools/tpmfromcat.xsl')
-rw-r--r-- | Build/tools/tpmfromcat.xsl | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Build/tools/tpmfromcat.xsl b/Build/tools/tpmfromcat.xsl new file mode 100644 index 00000000000..4276721c9c2 --- /dev/null +++ b/Build/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> |