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
3 <!-- This style sheet takes a sourceforge artifact in html and outputs
4 the attachment descriptions that it finds. The output is as follows:
7 <attachid>###</attachid>
14 <xsl:stylesheet version="1.0"
15 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
16 xmlns:xhtml="http://www.w3.org/1999/xhtml"
17 exclude-result-prefixes="xhtml">
19 <xsl:template match="xhtml:tr" mode="download">
22 <xsl:value-of select="substring-before(substring-after(xhtml:td[4]/descendant::xhtml:a/@href,'file_id='),'&')"/>
25 <xsl:value-of select="normalize-space(xhtml:td[3])"/>
30 <xsl:template match="xhtml:table[preceding-sibling::xhtml:h4='Attached Files:' and xhtml:tr/xhtml:td='Download']">
31 <xsl:for-each select="xhtml:tr[descendant::xhtml:a='Download']">
32 <xsl:apply-templates select="." mode="download"/>
36 <xsl:template match="/">
38 <xsl:apply-templates/>
39 <!-- A null description used as a fallback for when there is no
40 description listed for an attachment. -->
45 <xsl:template match="node()" priority="-1">
46 <xsl:apply-templates/>
49 <xsl:template match="text()" priority="-1"></xsl:template>