root/feedmelinks/import/import-delicious.xsl

Revision 857, 1.3 kB (checked in by hirokai, 3 years ago)

updated import code to handle Firefox, IE, and Del.icio.us

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3         <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
4
5         <xsl:variable name="d">___DELIMETER___</xsl:variable>
6
7         <xsl:template match="posts"><xsl:apply-templates/></xsl:template>
8
9         <xsl:template match="post"><xsl:value-of select="@href" /><xsl:value-of select="$d" /><xsl:value-of select="@description" /><xsl:if test="@extended"> - <xsl:value-of select="@extended" /></xsl:if><xsl:value-of select="$d" />imported links<xsl:call-template name="split">
10                         <xsl:with-param name="names" select="@tag"/>
11                         <xsl:with-param name="delim" select="$d"/>
12                 </xsl:call-template>
13 </xsl:template>
14
15         <xsl:template name="split">
16                 <xsl:param name="names"/>
17                 <xsl:param name="delim"/>
18                 <xsl:variable name="first" select='substring-before($names," ")'/>
19                 <xsl:variable name='rest' select='substring-after($names," ")'/>
20
21                 <xsl:if test='$first'><xsl:value-of select='$delim'/><xsl:value-of select='$first'/></xsl:if>
22
23                 <xsl:if test='$rest'>
24                         <xsl:call-template name='split'>
25                                 <xsl:with-param name='names' select='$rest'/>
26                                 <xsl:with-param name='delim' select='$delim'/>
27                         </xsl:call-template>
28                 </xsl:if>
29
30                 <xsl:if test='not($rest)'><xsl:value-of select='$delim'/><xsl:value-of select='$names'/></xsl:if>
31         </xsl:template>
32
33 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.