attachment_post.xsl
changeset 0 ae7b3fa753dc
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/attachment_post.xsl	Thu Nov 16 08:30:26 2006 +0000
     1.3 @@ -0,0 +1,38 @@
     1.4 +<?xml version="1.0"?>
     1.5 +
     1.6 +<!-- This stylesheet does some post-processing on attachments. -->
     1.7 +
     1.8 +<xsl:stylesheet version="1.0"
     1.9 +		xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    1.10 +
    1.11 +<xsl:template match="attachment">
    1.12 +  <!-- Avoid xsl:copy so that any attributes (including xml:base) are lost -->
    1.13 +  <attachment>
    1.14 +    <xsl:attribute name="ispatch">
    1.15 +      <xsl:value-of select="@ispatch"/>
    1.16 +    </xsl:attribute>
    1.17 +    <xsl:attribute name="isobsolete">
    1.18 +      <xsl:value-of select="isobsolete"/>
    1.19 +    </xsl:attribute>
    1.20 +    <xsl:apply-templates/>
    1.21 +  </attachment>
    1.22 +</xsl:template>
    1.23 +
    1.24 +<xsl:template match="attachment/isobsolete"/>
    1.25 +
    1.26 +<xsl:template match="attachment/desc[normalize-space(.)='']">
    1.27 +  <desc>
    1.28 +    <xsl:value-of select="../filename"/>
    1.29 +  </desc>
    1.30 +</xsl:template>
    1.31 +
    1.32 +<xsl:template match="*">
    1.33 +  <xsl:copy>
    1.34 +    <xsl:for-each select="@*">
    1.35 +      <xsl:copy/>
    1.36 +    </xsl:for-each>
    1.37 +    <xsl:apply-templates/>
    1.38 +  </xsl:copy>
    1.39 +</xsl:template>
    1.40 +
    1.41 +</xsl:stylesheet>