Personal tools

xslt

2 posts
  • NYTのオープンソース部隊 on by ultraviolet, [DB,OpenSource,PHP] Hatena Bookmark

    New York Times では社内に専属の Open Source プログラマがおり、nytimes.com を動かすためのPHP/MySQL用システムを開発しているのみならず、その成果である PHP XSL Cache Extention および DBSlayer のソースコードを公開している。

  • last.fm の XML を XSLT で RSS に変換 on by ultraviolet, [Programming,RSSFeed] Hatena Bookmark

    last.fm の RSS をはてな日記のRSSモジュールに読ませようとしたら、いまいちいい感じの出力にならんかったので、XML の方を RSS に整形する XSLT を書いて、これで変換して読み込ませることにしました。 <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="recenttracks"> <rss version="2.0" xmlns:creativeCommons= "http://backend.userland.com/creativeCommonsRssModule"> <channel> <language>en</language> <creativeCommons:license> http://creativecommons.org/licenses/by-nc-sa/2.0/uk/ </creativeCommons:license> <ttl>5</ttl> <docs>http://www.audioscrobbler.net/data/webservices</docs> <title>raurublock's Recently Played Tracks</title> <link>http://www.last.fm/user/raurublock/</link> <description>Last 10 tracks submitted to Last.fm</description> <xsl:apply-templates/> </channel> </rss> </xsl:template> <xsl:template match="track"> <item> <title><xsl:value-of select="./name"/></title> <description><xsl:value-of select="./artist"/></description> <link><xsl:value-of select="./url"/></link> <pubDate><xsl:value-of select="./date"/>:00 +0000</pubDate> [...]