summaryrefslogtreecommitdiffstats
path: root/xslt/yahoo2tellico.xsl
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-01 19:17:32 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-03-01 19:17:32 +0000
commite38d2351b83fa65c66ccde443777647ef5cb6cff (patch)
tree1897fc20e9f73a81c520a5b9f76f8ed042124883 /xslt/yahoo2tellico.xsl
downloadtellico-e38d2351b83fa65c66ccde443777647ef5cb6cff.tar.gz
tellico-e38d2351b83fa65c66ccde443777647ef5cb6cff.zip
Added KDE3 version of Tellico
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1097620 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'xslt/yahoo2tellico.xsl')
-rw-r--r--xslt/yahoo2tellico.xsl86
1 files changed, 86 insertions, 0 deletions
diff --git a/xslt/yahoo2tellico.xsl b/xslt/yahoo2tellico.xsl
new file mode 100644
index 0000000..4c6faf3
--- /dev/null
+++ b/xslt/yahoo2tellico.xsl
@@ -0,0 +1,86 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns="http://periapsis.org/tellico/"
+ xmlns:yh="urn:yahoo:srchmm"
+ xmlns:exsl="http://exslt.org/common"
+ extension-element-prefixes="exsl"
+ version="1.0">
+
+<!--
+ ===================================================================
+ Tellico XSLT file - used for importing Yahoo! album search data.
+
+ Copyright (C) 2004-2006 Robby Stephenson - [email protected]
+
+ This XSLT stylesheet is designed to be used with the 'Tellico'
+ application, which can be found at http://www.periapsis.org/tellico/
+
+ ===================================================================
+-->
+
+<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"
+ doctype-public="-//Robby Stephenson/DTD Tellico V10.0//EN"
+ doctype-system="http://periapsis.org/tellico/dtd/v10/tellico.dtd"/>
+
+<xsl:template match="/">
+ <tellico syntaxVersion="10">
+ <collection title="Yahoo! Import" type="4"> <!-- 4 is music -->
+ <fields>
+ <field name="_default"/>
+ <!-- the importer will actually download the image and ignore this field -->
+ <field flags="0" title="Yahoo Album" category="General" format="4" type="7" name="yahoo"/>
+ <field flags="0" title="Image" category="Images" format="4" type="7" name="image"/>
+ </fields>
+ <xsl:for-each select="yh:ResultSet/yh:Result">
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
+ </collection>
+ </tellico>
+</xsl:template>
+
+<xsl:template match="yh:Result">
+ <entry>
+ <yahoo>
+ <xsl:value-of select="@id"/>
+ </yahoo>
+
+ <image>
+ <xsl:value-of select="yh:Thumbnail/yh:Url"/>
+ </image>
+
+ <title>
+ <xsl:value-of select="yh:Title"/>
+ </title>
+
+ <artists>
+ <xsl:for-each select="yh:Artist">
+ <artist>
+ <xsl:value-of select="."/>
+ </artist>
+ </xsl:for-each>
+ </artists>
+
+ <year>
+ <xsl:call-template name="year">
+ <xsl:with-param name="value" select="yh:ReleaseDate"/>
+ </xsl:call-template>
+ </year>
+
+ <labels>
+ <xsl:for-each select="yh:Publisher">
+ <label>
+ <xsl:value-of select="."/>
+ </label>
+ </xsl:for-each>
+ </labels>
+ </entry>
+
+</xsl:template>
+
+<xsl:template name="year">
+ <xsl:param name="value"/>
+ <!-- assume that Yahoo always puts the year first -->
+ <xsl:value-of select="substring($value, 0, 5)"/>
+</xsl:template>
+
+</xsl:stylesheet>