blob: f9095806dadf9ecce6fd3442a8dd584c13898b83 [file] [log] [blame]
kbr_google38e9d272011-12-08 06:07:51 +00001<?xml version="1.0"?>
2
3<xsl:stylesheet version="1.0"
4 xmlns="http://www.w3.org/2005/Atom"
5 xmlns:a="http://www.w3.org/2005/Atom"
6 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
7
8<xsl:variable name="registry" select="document('registry.xml')/registry" />
9
10<xsl:template match="a:feed">
11 <xsl:copy>
12 <xsl:copy-of select="@*" />
13 <xsl:apply-templates select="*" />
14
15 <xsl:for-each select="$registry/*/history/revision">
16 <xsl:sort select="@date" order="descending"/>
kbr_google50797882012-05-17 03:24:48 +000017 <xsl:sort select="@number" order="descending"/>
kbr_google38e9d272011-12-08 06:07:51 +000018 <xsl:if test="position() &lt; 11">
19 <entry>
20 <title>
21 <xsl:value-of select="../../name" />
22 <xsl:text> : revision </xsl:text>
23 <xsl:value-of select="@number"/>
24 </title>
25 <link rel="alternate" type="text/html" href="{../../@href}"/>
26
27 <id><xsl:value-of select="../../@href"/>#r=<xsl:value-of select="@number"/></id>
28 <updated><xsl:value-of select="translate(@date,'/','-')"/>T23:59:59Z</updated>
29 <summary>
30 <xsl:for-each select="change">
David Sheetsf2849f62013-03-02 22:18:11 -080031 <xsl:value-of select="."/><xsl:text>&#xa;&#xa;</xsl:text>
kbr_google38e9d272011-12-08 06:07:51 +000032 </xsl:for-each>
33 </summary>
34 </entry>
35 </xsl:if>
36 </xsl:for-each>
37 </xsl:copy>
38</xsl:template>
39
40<xsl:template match="*">
41 <xsl:copy>
42 <xsl:copy-of select="@*" />
43 <xsl:apply-templates select="node()" />
44 </xsl:copy>
45</xsl:template>
46
47<xsl:template match="a:updated">
48 <xsl:for-each select="$registry/*/history/revision">
49 <xsl:sort select="@date"/>
50 <xsl:if test="position()=last()">
51 <updated>
52 <xsl:value-of select="translate(@date,'/','-')"/><xsl:text>T23:59:59Z</xsl:text>
53 </updated>
54 </xsl:if>
55 </xsl:for-each>
56</xsl:template>
57
58</xsl:stylesheet>