The FSFE planet, a blog aggregator of posts from our community https://planet.fsfe.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

foafroll.xml.xslt 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  2. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  3. xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  4. xmlns:foaf="http://xmlns.com/foaf/0.1/"
  5. xmlns:rss="http://purl.org/rss/1.0/"
  6. xmlns:dc="http://purl.org/dc/elements/1.1/"
  7. xmlns:atom="http://www.w3.org/2005/Atom"
  8. xmlns:planet="http://planet.intertwingly.net/"
  9. exclude-result-prefixes="atom planet">
  10. <xsl:output indent="yes" method="xml"/>
  11. <xsl:template match="atom:feed">
  12. <rdf:RDF>
  13. <foaf:Group>
  14. <foaf:name><xsl:value-of select="atom:author/atom:name"/></foaf:name>
  15. <foaf:homepage><xsl:value-of select="atom:author/atom:uri"/></foaf:homepage>
  16. <xsl:apply-templates select="planet:source"/>
  17. </foaf:Group>
  18. </rdf:RDF>
  19. </xsl:template>
  20. <xsl:template match="planet:source">
  21. <foaf:member>
  22. <foaf:Agent>
  23. <foaf:name><xsl:value-of select="planet:name"/></foaf:name>
  24. <foaf:weblog>
  25. <foaf:Document rdf:about="{atom:link[@rel='alternate']/@href}">
  26. <dc:title><xsl:value-of select="atom:title"/></dc:title>
  27. <rdfs:seeAlso>
  28. <rss:channel rdf:about="{atom:link[@rel='self']/@href}" />
  29. </rdfs:seeAlso>
  30. </foaf:Document>
  31. </foaf:weblog>
  32. </foaf:Agent>
  33. </foaf:member>
  34. </xsl:template>
  35. </xsl:stylesheet>