[pmwiki-users] A hint for pmwiker's gmane addicts
Dominique Faure
dominique.faure.1 at free.fr
Tue Aug 23 01:06:06 CDT 2005
Hi,
Here's a sub-recipe for those wanting feeds from Gmane in their wikis with
the help of the IncludeXML and the following page content (the count
optional parameter allow to limit the output):
===8---
(:xsl
xml=http://rss.gmane.org/messages/excerpts/gmane.comp.web.wiki.pmwiki.user
count=5:)
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://purl.org/net/rss1.1#"
xmlns:rss="http://purl.org/rss/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
version="1.0">
<xsl:output method="text" encoding="ISO-8859-1"/>
<xsl:param name="count"/>
<xsl:variable name="nl">
<xsl:text>
</xsl:text>
</xsl:variable>
<xsl:variable name="nl2" select="concat($nl, $nl)"/>
<xsl:template match="/rdf:RDF/rss:channel">
<xsl:text>!! %newwin%[[</xsl:text>
<xsl:value-of select="rss:link/."/>
<xsl:text>|</xsl:text>
<xsl:value-of select="rss:title/."/>
<xsl:text>]]</xsl:text>
<xsl:value-of select="$nl2"/>
<xsl:apply-templates select="/rdf:RDF/rss:item"/>
</xsl:template>
<xsl:template match="/rdf:RDF/rss:item">
<xsl:if test="string-length($count) = 0 or position() <= $count">
<xsl:text>* %newwin%[[</xsl:text>
<xsl:value-of select="rss:link/."/>
<xsl:text>|</xsl:text>
<xsl:value-of select="rss:title/."/>
<xsl:text>]]</xsl:text><xsl:value-of select="$nl"/>
</xsl:if>
</xsl:template>
<!-- Good ol' don't-pass-text-through -->
<xsl:template match="text()|@*"/>
</xsl:stylesheet>
(:xslend:)
===8---
Regards,
Dom
More information about the pmwiki-users
mailing list