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