diff options
author | Karl Berry <karl@freefriends.org> | 2005-12-28 00:04:28 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2005-12-28 00:04:28 +0000 |
commit | e6faeef3e4205722d36bbbb86b3b3390ab6527be (patch) | |
tree | b6bf2abd8e881f40beaca430df2e1c34c02c19ab /Master/Tools/collection2list.xsl | |
parent | 577983747d8680b8defbfdd03a9d50bad6fd54b7 (diff) |
trunk
git-svn-id: svn://tug.org/texlive/trunk@5 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/Tools/collection2list.xsl')
-rw-r--r-- | Master/Tools/collection2list.xsl | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/Master/Tools/collection2list.xsl b/Master/Tools/collection2list.xsl new file mode 100644 index 00000000000..8dd2838a1fe --- /dev/null +++ b/Master/Tools/collection2list.xsl @@ -0,0 +1,91 @@ +<!-- $Id: //depot/Master/Tools/collection2list.xsl#13 $ $Date: 2004/07/11 $ $Author: rahtz $ + Written by Sebastian Rahtz. Public domain. --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:exsl="http://exslt.org/common" + exclude-result-prefixes="exsl" + extension-element-prefixes="exsl" + xmlns:TPM="http://texlive.dante.de/" + version="1.0"> + +<xsl:output method="xml" omit-xml-declaration="yes"/> + +<xsl:strip-space elements="*"/> + +<!-- assume the current directory is Master, as Tools/update arranges. --> +<xsl:param name="ROOT">.</xsl:param> + +<xsl:variable name="Master"> + <xsl:value-of select="$ROOT"/>/texmf/lists/</xsl:variable> +<xsl:variable name="COL">texmf/tpm/</xsl:variable> +<xsl:variable name="LISTS">texmf/lists/</xsl:variable> + +<xsl:template match="/"> + <!-- + <xsl:message>Write <xsl:value-of select="concat($Master,.//TPM:Name)"/></xsl:message> +--> + <exsl:document href="{concat($Master,//TPM:Name)}" method="text"> +<xsl:text>*Title: </xsl:text> + <xsl:value-of select="normalize-space(.//TPM:Title)"/> +<xsl:text> </xsl:text> +<xsl:text>*Size: </xsl:text> + <xsl:call-template name="findSize"/> + <xsl:text> </xsl:text> + <xsl:apply-templates select=".//TPM:Requires"/> + <xsl:apply-templates select=".//TPM:DocFiles"/><xsl:text> </xsl:text> + <xsl:apply-templates select=".//TPM:SourceFiles"/><xsl:text> </xsl:text> + <xsl:apply-templates select=".//TPM:RunFiles"/><xsl:text> </xsl:text> + <xsl:text> </xsl:text> + <xsl:value-of select="$LISTS"/> + <xsl:value-of select=".//TPM:Name"/> + <xsl:text> </xsl:text> + </exsl:document> +</xsl:template> + +<xsl:template match="TPM:DocFiles|TPM:SourceFiles|TPM:RunFiles"> + <xsl:value-of select="translate(normalize-space(.),' ',' ')"/> +</xsl:template> + +<xsl:template match="TPM:Requires"> +<xsl:for-each select="TPM:Documentation|TPM:Package|TPM:TLCore"> +<xsl:text>+</xsl:text> +<xsl:value-of select="translate(normalize-space(@name),' ',' ')"/> +<xsl:text> </xsl:text> +</xsl:for-each> +<xsl:for-each select="TPM:Collection"> +<xsl:text>-</xsl:text> +<xsl:value-of select="translate(normalize-space(@name),' ',' ')"/> +<xsl:text> </xsl:text> +</xsl:for-each> +</xsl:template> + +<xsl:template name="findSize"> + <xsl:variable name="Sizes"> + <Sizes> + <Size><xsl:value-of select=".//TPM:Size"/></Size> + <xsl:for-each select=".//TPM:Requires"> + <xsl:for-each select="TPM:Documentation"> + <xsl:for-each + select="document(concat($ROOT,'/texmf-doc/tpm/',@name,'.tpm'))"> + <Size><xsl:value-of select=".//TPM:Size"/></Size> + </xsl:for-each> + </xsl:for-each> + <xsl:for-each select="TPM:Package"> + <xsl:for-each + select="document(concat($ROOT,'/texmf-dist/tpm/',@name,'.tpm'))"> + <Size><xsl:value-of select=".//TPM:Size"/></Size> + </xsl:for-each> + </xsl:for-each> + <xsl:for-each select="TPM:Core"> + <xsl:for-each + select="document(concat($ROOT,'/texmf/tpm/',@name,'.tpm'))"> + <Size><xsl:value-of select=".//TPM:Size"/></Size> + </xsl:for-each> + </xsl:for-each> + </xsl:for-each> + </Sizes> + </xsl:variable> +<xsl:value-of select="sum(exsl:node-set($Sizes)//Size)"/> +</xsl:template> + +</xsl:stylesheet> |