* [gentoo-commits] gentoo commit in xml/htdocs/xsl: rdf.xsl
@ 2008-01-29 17:08 Xavier Neys (neysx)
0 siblings, 0 replies; 2+ messages in thread
From: Xavier Neys (neysx) @ 2008-01-29 17:08 UTC (permalink / raw
To: gentoo-commits
neysx 08/01/29 17:08:56
Modified: rdf.xsl
Log:
#174455 Add html to feed
Revision Changes Path
1.7 xml/htdocs/xsl/rdf.xsl
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/rdf.xsl?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/rdf.xsl?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/rdf.xsl?r1=1.6&r2=1.7
Index: rdf.xsl
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/rdf.xsl,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- rdf.xsl 25 Sep 2006 19:52:13 -0000 1.6
+++ rdf.xsl 29 Jan 2008 17:08:56 -0000 1.7
@@ -1,45 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:admin="http://webns.net/mvcb/"
- xmlns:dc="http://purl.org/dc/elements/1.1/">
+ xmlns="http://purl.org/rss/1.0/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:admin="http://webns.net/mvcb/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:exslt="http://exslt.org/common"
+ extension-element-prefixes="exslt"
+>
+
+<xsl:strip-space elements="*"/>
+
+<!-- Bring in all guide.xsl shebang to apply-templates to the news <body>,
+ http://bugs.gentoo.org/204402
+-->
+<xsl:include href="/xsl/guide.xsl"/>
+
<xsl:output encoding="UTF-8" method="xml" indent="yes" cdata-section-elements="description" />
+
<xsl:template match="/rdffeed">
<rdf:RDF>
- <channel>
- <xsl:attribute name="rdf:about"><xsl:value-of select="link" /></xsl:attribute>
- <title><xsl:value-of select="title" /></title>
- <link><xsl:value-of select="link" /></link>
- <description><xsl:value-of select="description" /></description>
- <dc:creator>www@gentoo.org</dc:creator>
- <dc:language>en-US</dc:language>
- <admin:errorReportsTo rdf:resource="mailto:www@gentoo.org" />
- <items>
- <rdf:Seq>
- <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()<11]/text()">
- <rdf:li>
- <xsl:attribute name="rdf:resource">http://www.gentoo.org<xsl:value-of select="." /></xsl:attribute>
- </rdf:li>
- </xsl:for-each>
- </rdf:Seq>
- </items>
- </channel>
-
- <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()<11]/text()">
- <item>
- <xsl:attribute name="rdf:about">http://www.gentoo.org<xsl:value-of select="." /></xsl:attribute>
- <title><xsl:value-of select="document(.)/news/title" /></title>
- <link>http://www.gentoo.org<xsl:value-of select="." /></link>
- <dc:subject><xsl:value-of select="document(.)/news/@category" /></dc:subject>
- <dc:creator><xsl:value-of select="document(.)/news/poster" /></dc:creator>
- <!-- <dc:date><xsl:value-of select="document(.)/news/date" /></dc:date> -->
- <description><xsl:value-of select="document(.)/news/body" /></description>
- </item>
- </xsl:for-each>
+ <channel>
+ <xsl:attribute name="rdf:about"><xsl:value-of select="link" /></xsl:attribute>
+ <title><xsl:value-of select="title" /></title>
+ <link><xsl:value-of select="link" /></link>
+ <description><xsl:value-of select="description" /></description>
+ <dc:creator>www@gentoo.org</dc:creator>
+ <dc:language>en-US</dc:language>
+ <admin:errorReportsTo rdf:resource="mailto:www@gentoo.org" />
+ <items>
+ <rdf:Seq>
+ <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()<11]/text()">
+ <rdf:li>
+ <xsl:attribute name="rdf:resource">http://www.gentoo.org<xsl:value-of select="." /></xsl:attribute>
+ </rdf:li>
+ </xsl:for-each>
+ </rdf:Seq>
+ </items>
+ </channel>
+
+ <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()<11]/text()">
+ <xsl:variable name="da-news" select="document(.)"/>
+ <xsl:if test="$da-news/news/title">
+ <item>
+ <xsl:attribute name="rdf:about">http://www.gentoo.org<xsl:value-of select="." /></xsl:attribute>
+ <title><xsl:value-of select="$da-news/news/title" /></title>
+ <link>http://www.gentoo.org<xsl:value-of select="." /></link>
+ <dc:subject><xsl:value-of select="$da-news/news/@category" /></dc:subject>
+ <dc:creator><xsl:value-of select="$da-news/news/poster" /></dc:creator>
+ <!-- <dc:date><xsl:value-of select="document(.)/news/date" /></dc:date> -->
+ <xsl:variable name="xmlnews"><xsl:apply-templates select="$da-news/news/body"/></xsl:variable>
+ <xsl:variable name="txtnews"><xsl:apply-templates select="exslt:node-set($xmlnews)" mode="txtnews"/></xsl:variable>
+ <description>
+ <xsl:value-of disable-output-escaping="yes" select="$txtnews"/>
+ </description>
+ </item>
+ </xsl:if>
+ </xsl:for-each>
</rdf:RDF>
</xsl:template>
+
+<xsl:template match="node()" mode="txtnews">
+ <xsl:choose>
+ <xsl:when test="self::text()">
+ <xsl:value-of disable-output-escaping="yes" select="."/>
+ </xsl:when>
+ <xsl:when test="self::*">
+ <xsl:text disable-output-escaping="yes"><</xsl:text><xsl:value-of select="name(.)"/>
+ <xsl:apply-templates select="@*" mode="txtnews"/>
+ <xsl:text disable-output-escaping="yes">></xsl:text>
+ <xsl:apply-templates mode="txtnews"/>
+ <xsl:text disable-output-escaping="yes"></</xsl:text><xsl:value-of select="name(.)"/><xsl:text disable-output-escaping="yes">></xsl:text>
+ </xsl:when>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="@class | @style" mode="txtnews"/>
+
+<xsl:template match="@*" mode="txtnews">
+ <xsl:value-of select="concat(' ', name(.))"/><xsl:text>=</xsl:text>
+ <xsl:text>"</xsl:text>
+ <xsl:choose>
+ <xsl:when test="name(.)='href' and starts-with(., '/')"><xsl:value-of select="concat('http://www.gentoo.org', .)"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>"</xsl:text>
+</xsl:template>
+
</xsl:stylesheet>
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 2+ messages in thread
* [gentoo-commits] gentoo commit in xml/htdocs/xsl: rdf.xsl
@ 2008-03-23 10:14 Xavier Neys (neysx)
0 siblings, 0 replies; 2+ messages in thread
From: Xavier Neys (neysx) @ 2008-03-23 10:14 UTC (permalink / raw
To: gentoo-commits
neysx 08/03/23 10:14:33
Modified: rdf.xsl
Log:
Handle poster's nick like in guide.xsl, i.e. grab name from roll-call
Revision Changes Path
1.8 xml/htdocs/xsl/rdf.xsl
file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/rdf.xsl?rev=1.8&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/rdf.xsl?rev=1.8&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/rdf.xsl?r1=1.7&r2=1.8
Index: rdf.xsl
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/rdf.xsl,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- rdf.xsl 29 Jan 2008 17:08:56 -0000 1.7
+++ rdf.xsl 23 Mar 2008 10:14:32 -0000 1.8
@@ -48,7 +48,12 @@
<title><xsl:value-of select="$da-news/news/title" /></title>
<link>http://www.gentoo.org<xsl:value-of select="." /></link>
<dc:subject><xsl:value-of select="$da-news/news/@category" /></dc:subject>
- <dc:creator><xsl:value-of select="$da-news/news/poster" /></dc:creator>
+ <xsl:variable name="poster">
+ <xsl:call-template name="smart-mail">
+ <xsl:with-param name="mail" select="$da-news/news/poster"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <dc:creator><xsl:value-of select="$poster" /></dc:creator>
<!-- <dc:date><xsl:value-of select="document(.)/news/date" /></dc:date> -->
<xsl:variable name="xmlnews"><xsl:apply-templates select="$da-news/news/body"/></xsl:variable>
<xsl:variable name="txtnews"><xsl:apply-templates select="exslt:node-set($xmlnews)" mode="txtnews"/></xsl:variable>
--
gentoo-commits@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-23 10:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-23 10:14 [gentoo-commits] gentoo commit in xml/htdocs/xsl: rdf.xsl Xavier Neys (neysx)
-- strict thread matches above, loose matches on Subject: below --
2008-01-29 17:08 Xavier Neys (neysx)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox