root/trunk/gregarius/css/opml.xsl

Revision 1327, 2.0 kB (checked in by mbonetti, 3 years ago)

OPML xslt stlesheet should now look in themes/default/web/css

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3 mbi: largely inspired by the excellent work by Makenshi: http://chaz6.com/static/xml/test.opml
4-->
5<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
6        <xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" doctype-public="-//W3C//DTD XHTML 1.1//EN"/>
7       
8
9        <xsl:param name="sort-type" select="'text'"/>
10        <xsl:param name="sort-order" select="'ascending'"/>
11
12        <xsl:template match="/">
13                <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
14                        <head>
15                                 <title><xsl:value-of select="/opml/head/title"/></title> 
16                                <link rel="stylesheet" href="themes/default/web/css/look.css" type="text/css" />
17                                <link rel="stylesheet" href="themes/default/web/css/layout.css" type="text/css" />
18                        </head>
19            <xsl:apply-templates select="opml/body" />
20                </html>
21        </xsl:template>
22        <xsl:template match="opml/body">
23                <body>
24                        <div id="opml" class="frame">
25                                        <h1><xsl:value-of select="/opml/head/title" /></h1>                     
26                                                <ul>
27                                                <xsl:apply-templates select="outline">
28                                                        <xsl:sort select="@title"/>
29                                                </xsl:apply-templates>
30                                                </ul>
31                         </div>
32                </body>
33        </xsl:template>
34
35        <xsl:template match="outline">
36                <xsl:choose>
37                        <xsl:when test="not(@xmlUrl)">
38                                <li class="folder"><span><xsl:value-of select="@text"/></span></li>
39                                <li><ul>
40                                  <xsl:apply-templates select="outline"><xsl:sort select="@text"/></xsl:apply-templates>
41                                </ul>
42                                </li>
43                        </xsl:when>
44                        <xsl:otherwise>
45                                <li>
46                                  <span style="font-weight:900">
47                                    <xsl:value-of select="@text"/>
48                                  </span>
49                                [<a href="{@xmlUrl}">xml</a>
50                                <xsl:choose>
51                                        <xsl:when test="starts-with(@htmlUrl,'http')">|<a href="{@htmlUrl}">www</a>
52                                        </xsl:when>
53                                </xsl:choose>]
54                                <xsl:choose>
55                                    <xsl:when test="string-length(@description)">
56                                      <span style="margin-left: 10px;">(<xsl:value-of select="@description"/>)</span>
57                                    </xsl:when>
58                                </xsl:choose>
59                                </li>
60                        </xsl:otherwise>
61                </xsl:choose>
62        </xsl:template>
63
64</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.