get_users.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 <xsl:stylesheet version="1.0"
     3 		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     4 		xmlns:exsl="http://exslt.org/common"
     5 		extension-element-prefixes="exsl">
     6 
     7 <xsl:variable name="users">
     8   <xsl:for-each select="//artifact/field[@name='submitted_by' or @name='assigned_to']">
     9     <user><xsl:value-of select="normalize-space(.)"/></user>
    10   </xsl:for-each>
    11   <xsl:for-each select="//artifact/field[@name='artifact_history']/history/field[@name='mod_by']">
    12     <user><xsl:value-of select="normalize-space(.)"/></user>
    13   </xsl:for-each>
    14   <xsl:for-each select="//artifact/field[@name='artifact_messages']/message/field[@name='user_name']">
    15     <user><xsl:value-of select="normalize-space(.)"/></user>
    16   </xsl:for-each>
    17 </xsl:variable>
    18 
    19 <xsl:variable name="sorted_users">
    20   <xsl:for-each select="exsl:node-set($users)/user">
    21     <xsl:sort/>
    22     <xsl:copy-of select="."/>
    23   </xsl:for-each>
    24 </xsl:variable>
    25 
    26 <xsl:template match="/">
    27   <users>
    28     <xsl:for-each select="exsl:node-set($sorted_users)/user">
    29       <xsl:if test="not(. = following-sibling::user[1])">
    30 	<user>
    31 	  <xsl:value-of select="."/>
    32 	  <xsl:text>@users.sourceforge.net</xsl:text>
    33 	</user>
    34       </xsl:if>
    35     </xsl:for-each>
    36   </users>
    37 </xsl:template>
    38 
    39 </xsl:stylesheet>