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: Thu, 11 Oct 2007 15:41:26
Message-Id: E1Ig00X-0006bb-An@stork.gentoo.org
1 neysx 07/10/11 15:31:29
2
3 Modified: devlist.xsl
4 Log:
5 Added xml mode
6
7 Revision Changes Path
8 1.4 xml/htdocs/xsl/devlist.xsl
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/devlist.xsl?rev=1.4&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/devlist.xsl?rev=1.4&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/devlist.xsl?r1=1.3&r2=1.4
13
14 Index: devlist.xsl
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/devlist.xsl,v
17 retrieving revision 1.3
18 retrieving revision 1.4
19 diff -u -r1.3 -r1.4
20 --- devlist.xsl 18 Sep 2007 07:04:18 -0000 1.3
21 +++ devlist.xsl 11 Oct 2007 15:31:28 -0000 1.4
22 @@ -30,13 +30,18 @@
23 <xsl:attribute name="lon"><xsl:value-of select="location/@longitude"/></xsl:attribute>
24 <xsl:attribute name="lat"><xsl:value-of select="location/@latitude"/></xsl:attribute>
25 </xsl:if>
26 - <xsl:value-of select="location"/>
27 + <xsl:value-of select="normalize-space(location)"/>
28 </location>
29 <roles><xsl:value-of select="normalize-space(roles)"/></roles>
30 - <location><xsl:value-of select="normalize-space(location)"/></location>
31 - <xsl:if test="string-length(status) > 0">
32 + <xsl:if test="string-length(status) > 0">
33 <status><xsl:value-of select="translate(normalize-space(status),'QWERTYUIOPLKJHGFDSAZXCVBNM','qwertyuioplkjhgfdsazxcvbnm')"/></status>
34 - </xsl:if>
35 + </xsl:if>
36 + <xsl:if test="email[@role='gentoo']">
37 + <email role="gentoo"><xsl:value-of select="email[@role='gentoo'][1]"/></email>
38 + </xsl:if>
39 + <xsl:if test="email[@role!='gentoo']">
40 + <email role="other"><xsl:value-of select="email[@role!='gentoo'][1]"/></email>
41 + </xsl:if>
42 </user>
43 </xsl:for-each>
44 </xsl:variable>
45 @@ -49,6 +54,9 @@
46 <xsl:when test="$mode='kml'">
47 <xsl:apply-templates mode="kml"/>
48 </xsl:when>
49 + <xsl:when test="$mode='xml'">
50 + <xsl:apply-templates mode="xml"/>
51 + </xsl:when>
52 <xsl:otherwise>
53 <xsl:apply-templates/>
54 </xsl:otherwise>
55 @@ -113,4 +121,37 @@
56 </Placemark>
57 </xsl:template>
58
59 +
60 +<!-- xml for sites where no roll-call is available -->
61 +<xsl:template match="/devlist" mode="xml" xmlns=''>
62 +<xsl:text disable-output-escaping="yes">&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#xA;</xsl:text>
63 + <xsl:element name="userlist">
64 + <xsl:apply-templates select="exslt:node-set($rollcall)/user" mode="xml"/>
65 + </xsl:element>
66 +</xsl:template>
67 +
68 +<xsl:template match="user" mode="xml" xmlns=''>
69 + <xsl:element name="user">
70 + <xsl:attribute name="username"><xsl:value-of select="@nick"/></xsl:attribute>
71 + <realname><xsl:attribute name="fullname"><xsl:value-of select="name/text()"/></xsl:attribute></realname>
72 + <pgpkey><xsl:value-of select="pgpkey"/></pgpkey>
73 + <location>
74 + <xsl:if test="location/@lon and location/@lat">
75 + <xsl:attribute name="longitude"><xsl:value-of select="location/@lon"/></xsl:attribute>
76 + <xsl:attribute name="latitude"><xsl:value-of select="location/@lat"/></xsl:attribute>
77 + </xsl:if>
78 + <xsl:value-of select="location"/>
79 + </location>
80 + <xsl:if test="status">
81 + <status><xsl:value-of select="status"/></status>
82 + </xsl:if>
83 + <xsl:if test="email[@role='gentoo']">
84 + <email role="gentoo"><xsl:value-of select="email[@role='gentoo']"/></email>
85 + </xsl:if>
86 + <xsl:if test="email[@role='other']">
87 + <email role="other"><xsl:value-of select="email[@role='other']"/></email>
88 + </xsl:if>
89 + </xsl:element>
90 +</xsl:template>
91 +
92 </xsl:stylesheet>
93
94
95
96 --
97 gentoo-commits@g.o mailing list