Gentoo Archives: gentoo-commits

From: "Xavier Neys (neysx)" <neysx@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/xsl: glsa.xsl
Date: Fri, 19 Oct 2007 15:36:00
Message-Id: E1Iitiy-0008MU-6U@stork.gentoo.org
1 neysx 07/10/19 15:25:20
2
3 Modified: glsa.xsl
4 Log:
5 Make GLSAs generate valid GuideXML
6
7 Revision Changes Path
8 1.16 xml/htdocs/xsl/glsa.xsl
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/glsa.xsl?rev=1.16&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/glsa.xsl?rev=1.16&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/glsa.xsl?r1=1.15&r2=1.16
13
14 Index: glsa.xsl
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/glsa.xsl,v
17 retrieving revision 1.15
18 retrieving revision 1.16
19 diff -u -r1.15 -r1.16
20 --- glsa.xsl 9 Apr 2004 17:38:28 -0000 1.15
21 +++ glsa.xsl 19 Oct 2007 15:25:19 -0000 1.16
22 @@ -1,12 +1,20 @@
23 <?xml version="1.0" encoding="iso-8859-1"?>
24 -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
25 -<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
26 +<xsl:stylesheet version="1.0"
27 + xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28 + xmlns:exslt="http://exslt.org/common"
29 + xmlns:str="http://exslt.org/strings"
30 + exclude-result-prefixes="exslt str">
31 +
32 +<xsl:output encoding="UTF-8"
33 + method="xml"
34 + indent="yes"
35 + doctype-system="/dtd/guide.dtd"/>
36
37 <xsl:template match="glsa">
38 <guide>
39 <title><xsl:value-of select="title"/></title>
40 <author title="Contact Address">
41 - <mail link="security@g.o">security@g.o</mail>
42 + <mail link="security@g.o">Security Team</mail>
43 </author>
44 <abstract>
45 This is a Gentoo Linux Security Advisory
46 @@ -75,13 +83,14 @@
47 <title>Synopsis</title>
48 <body>
49
50 -<xsl:apply-templates select="synopsis"/>
51 +<p><xsl:apply-templates select="synopsis"/></p>
52
53 </body>
54 </section>
55 </chapter>
56 <chapter>
57 <title>Impact Information</title>
58 +<xsl:if test="background">
59 <section>
60 <title>Background</title>
61 <body>
62 @@ -90,6 +99,7 @@
63
64 </body>
65 </section>
66 +</xsl:if>
67 <section>
68 <title>Description</title>
69 <body>
70 @@ -134,14 +144,7 @@
71
72 <ul>
73 <xsl:for-each select="references/uri">
74 - <xsl:choose>
75 - <xsl:when test="@link">
76 - <li><uri link="{@link}"><xsl:value-of select="text()"/></uri></li>
77 - </xsl:when>
78 - <xsl:otherwise>
79 - <li><uri link="{text()}"><xsl:value-of select="text()"/></uri></li>
80 - </xsl:otherwise>
81 - </xsl:choose>
82 + <li><xsl:apply-templates select="."/></li>
83 </xsl:for-each>
84 </ul>
85
86 @@ -303,8 +306,10 @@
87 </xsl:template>
88
89 <xsl:template match="code">
90 -<pre>
91 -<xsl:apply-templates select="text()"/>
92 +<pre caption="{concat(translate(substring(name(..),1,1),'wrd','WRD'),substring(name(..),2))}">
93 +<xsl:for-each select="str:tokenize(text(),'&#xA;')">
94 + <xsl:value-of select="concat(substring-after(.,' '), '&#xA;')"/>
95 +</xsl:for-each>
96 </pre>
97 </xsl:template>
98
99 @@ -344,18 +349,33 @@
100 <b><xsl:apply-templates/></b>
101 </xsl:template>
102
103 -<xsl:template match="u">
104 -<u><xsl:apply-templates/></u>
105 -</xsl:template>
106 -
107 <xsl:template match="i">
108 -<span class="input"><xsl:apply-templates/></span>
109 +<c><xsl:apply-templates/></c>
110 </xsl:template>
111
112 <xsl:template match="br">
113 <br/>
114 </xsl:template>
115
116 +<xsl:template match="mail|uri">
117 + <xsl:element name="{name(.)}">
118 + <xsl:choose>
119 + <xsl:when test="translate(normalize-space(text()),' ','') = @link">
120 + <xsl:value-of select="@link"/>
121 + </xsl:when>
122 + <xsl:when test="@link">
123 + <xsl:attribute name="link">
124 + <xsl:value-of select="@link"/>
125 + </xsl:attribute>
126 + <xsl:value-of select="normalize-space(.)"/>
127 + </xsl:when>
128 + <xsl:otherwise>
129 + <xsl:value-of select="normalize-space(.)"/>
130 + </xsl:otherwise>
131 + </xsl:choose>
132 + </xsl:element>
133 +</xsl:template>
134 +
135 <xsl:template match="metadata">
136 </xsl:template>
137
138
139
140
141 --
142 gentoo-commits@g.o mailing list