bugzilla_post.xsl
author ali@yendor.vm.bytemark.co.uk
Thu Nov 16 08:30:26 2006 +0000 (2006-11-16)
changeset 0 ae7b3fa753dc
permissions -rw-r--r--
First cut. Distintly raw around the edges:
* Assumes it will be running in /home/ali/wk/slashem/web.scripts
* Assumes cache directory will be in topdir
* No build system (simple compiling and linking against libxml2)
* No configure system (eg., tagsoup)
* Output XML untested
* Doesn't set bugzilla maintainer or exporter
* Handling of artifact priorities and resolution is suspect
     1 <?xml version="1.0"?>
     2 
     3 <!-- This stylesheet does some post-processing on the bugzilla output. -->
     4 
     5 <xsl:stylesheet version="1.0"
     6 		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     7 		xmlns:sf2bz="http://project.juiblex.co.uk/sf2bz"
     8 		exclude-result-prefixes="sf2bz">
     9 
    10 <xsl:template match="//sf2bz:element">
    11   <xsl:element name="{@name}">
    12     <xsl:for-each select="sf2bz:copy-from/*/*|sf2bz:copy-from/*/@*|sf2bz:copy-from/*/text()">
    13       <xsl:copy/>
    14     </xsl:for-each>
    15   </xsl:element>
    16 </xsl:template>
    17 
    18 <!-- Kill all the xmlns:* and xml:base attributes
    19      (none of which are relevant any more) -->
    20 <xsl:template match="*">
    21   <xsl:element name="{name()}">
    22     <xsl:for-each select="@*">
    23       <xsl:if test="name(.) != 'xml:base'">
    24 	<xsl:copy/>
    25       </xsl:if>
    26     </xsl:for-each>
    27     <xsl:apply-templates/>
    28   </xsl:element>
    29 </xsl:template>
    30 
    31 </xsl:stylesheet>