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: devlist.xsl
Date: Tue, 18 Sep 2007 07:12:01
Message-Id: E1IXX87-0001EU-5v@stork.gentoo.org
1 neysx 07/09/18 07:04:19
2
3 Modified: devlist.xsl
4 Log:
5 Added retired devs and status column to passwd format on phreak's request
6
7 Revision Changes Path
8 1.3 xml/htdocs/xsl/devlist.xsl
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/devlist.xsl?rev=1.3&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/devlist.xsl?rev=1.3&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/devlist.xsl?r1=1.2&r2=1.3
13
14 Index: devlist.xsl
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/devlist.xsl,v
17 retrieving revision 1.2
18 retrieving revision 1.3
19 diff -u -r1.2 -r1.3
20 --- devlist.xsl 25 Mar 2007 10:02:32 -0000 1.2
21 +++ devlist.xsl 18 Sep 2007 07:04:18 -0000 1.3
22 @@ -3,14 +3,16 @@
23 xmlns:exslt="http://exslt.org/common"
24 xmlns="http://earth.google.com/kml/2.1"
25 extension-element-prefixes="exslt">
26 -<xsl:output omit-xml-declaration="yes" indent="yes" cdata-section-elements="description"/>
27 +
28 +<xsl:output omit-xml-declaration="yes"
29 + indent="yes"
30 + cdata-section-elements="description"/>
31
32 <xsl:param name="mode"/>
33
34 <xsl:variable name="rollcall" xmlns="">
35 <xsl:for-each select="document('userinfo.xml', .)/userlist/user">
36 <xsl:sort select="@username"/>
37 - <xsl:if test="translate(status,'tired', 'TIRED')!='RETIRED'">
38 <user nick="{@username}">
39 <name>
40 <xsl:choose>
41 @@ -31,8 +33,11 @@
42 <xsl:value-of select="location"/>
43 </location>
44 <roles><xsl:value-of select="normalize-space(roles)"/></roles>
45 + <location><xsl:value-of select="normalize-space(location)"/></location>
46 + <xsl:if test="string-length(status) > 0">
47 + <status><xsl:value-of select="translate(normalize-space(status),'QWERTYUIOPLKJHGFDSAZXCVBNM','qwertyuioplkjhgfdsazxcvbnm')"/></status>
48 + </xsl:if>
49 </user>
50 - </xsl:if>
51 </xsl:for-each>
52 </xsl:variable>
53
54 @@ -53,13 +58,13 @@
55
56 <!-- Default mode, similar to /etc/passwd -->
57 <xsl:template match="/devlist">
58 -<xsl:text>#nick:name:location:latitude:longitude:pgpkey
59 +<xsl:text>#nick:name:location:latitude:longitude:pgpkey:status
60 </xsl:text>
61 <xsl:apply-templates select="exslt:node-set($rollcall)/user"/>
62 </xsl:template>
63
64 <xsl:template match="user">
65 - <xsl:value-of select="concat(@nick, ':', name, ':', location, ':', location/@lat, ':', location/@lon, ':', pgpkey, '&#xA;')"/>
66 + <xsl:value-of select="concat(@nick, ':', name, ':', location, ':', location/@lat, ':', location/@lon, ':', pgpkey, ':', status, '&#xA;')"/>
67 </xsl:template>
68
69
70 @@ -68,7 +73,7 @@
71 <xsl:text>{
72 "developers": [
73 </xsl:text>
74 -<xsl:apply-templates select="exslt:node-set($rollcall)/user[location/@lat]" mode="yaml"/>
75 +<xsl:apply-templates select="exslt:node-set($rollcall)/user[location/@lat and not(status)]" mode="yaml"/>
76 <xsl:text> ]
77 }
78 </xsl:text>
79 @@ -78,7 +83,8 @@
80 <xsl:variable name="single-quote">'</xsl:variable>
81 <xsl:variable name="double-quote">"</xsl:variable>
82 <xsl:variable name="roles" select="translate(roles, $double-quote, $single-quote)"/>
83 - <xsl:value-of select="concat(' {&#34;nick&#34;: &#34;', @nick,'&#34;, &#34;name&#34;: &#34;', name, '&#34;, &#34;lat&#34;: ', location/@lat, ', &#34;lon&#34;: ', location/@lon, ', &#34;roles&#34;: &#34;', $roles, '&#34;}')"/>
84 + <xsl:variable name="loc" select="translate(location, $double-quote, $single-quote)"/>
85 + <xsl:value-of select="concat(' {&#34;nick&#34;: &#34;', @nick,'&#34;, &#34;name&#34;: &#34;', name, '&#34;, &#34;lat&#34;: ', location/@lat, ', &#34;lon&#34;: ', location/@lon, ', &#34;roles&#34;: &#34;', $roles, '&#34;, &#34;loc&#34;: &#34;', $loc, '&#34;}')"/>
86 <xsl:if test="position()!=last()">,</xsl:if>
87 <xsl:text>&#xA;</xsl:text>
88 </xsl:template>
89 @@ -89,7 +95,7 @@
90 <xsl:text disable-output-escaping="yes">&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#xA;</xsl:text>
91 <kml>
92 <Document>
93 - <xsl:apply-templates select="exslt:node-set($rollcall)/user" mode="kml"/>
94 + <xsl:apply-templates select="exslt:node-set($rollcall)/user[location/@lat and not(status)]" mode="kml"/>
95 </Document>
96 </kml>
97 </xsl:template>
98
99
100
101 --
102 gentoo-commits@g.o mailing list