<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: opml code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Thu, 24 Jul 2008 04:20:36 GMT</pubDate>
    <description>DZone Snippets: opml code</description>
    <item>
      <title>opml xsl transformation schema</title>
      <link>http://snippets.dzone.com/posts/show/3653</link>
      <description>// description of your code here&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&lt;!-- &lt;br /&gt; mbi: largely inspired by the excellent work by Makenshi: http://chaz6.com/static/xml/test.opml &lt;br /&gt;--&gt;&lt;br /&gt;&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt;&lt;br /&gt;	&lt;xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" doctype-public="-//W3C//DTD XHTML 1.1//EN"/&gt;&lt;br /&gt;	&lt;br /&gt;&lt;br /&gt;	&lt;xsl:param name="sort-type" select="'text'"/&gt;&lt;br /&gt;	&lt;xsl:param name="sort-order" select="'ascending'"/&gt;&lt;br /&gt;&lt;br /&gt;	&lt;xsl:template match="/"&gt;&lt;br /&gt;		&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;&lt;br /&gt;			&lt;head&gt;&lt;br /&gt;				 &lt;title&gt;&lt;xsl:value-of select="/opml/head/title"/&gt;&lt;/title&gt; &lt;br /&gt;				&lt;link rel="stylesheet" href="themes/default/web/css/look.css" type="text/css" /&gt;&lt;br /&gt;				&lt;link rel="stylesheet" href="themes/default/web/css/layout.css" type="text/css" /&gt;&lt;br /&gt;			&lt;/head&gt;&lt;br /&gt;            &lt;xsl:apply-templates select="opml/body" /&gt;&lt;br /&gt;		&lt;/html&gt;&lt;br /&gt;	&lt;/xsl:template&gt;&lt;br /&gt;	&lt;xsl:template match="opml/body"&gt;&lt;br /&gt;		&lt;body&gt;&lt;br /&gt;			&lt;div id="opml" class="frame"&gt;&lt;br /&gt;					&lt;h1&gt;&lt;xsl:value-of select="/opml/head/title" /&gt;&lt;/h1&gt;			&lt;br /&gt;						&lt;ul&gt;&lt;br /&gt;						&lt;xsl:apply-templates select="outline"&gt;&lt;br /&gt;							&lt;xsl:sort select="@title"/&gt;&lt;br /&gt;						&lt;/xsl:apply-templates&gt;&lt;br /&gt;						&lt;/ul&gt;&lt;br /&gt;			 &lt;/div&gt;&lt;br /&gt;		&lt;/body&gt;&lt;br /&gt;	&lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;	&lt;xsl:template match="outline"&gt;&lt;br /&gt;		&lt;xsl:choose&gt;&lt;br /&gt;			&lt;xsl:when test="not(@xmlUrl)"&gt;&lt;br /&gt;				&lt;li class="folder"&gt;&lt;span&gt;&lt;xsl:value-of select="@text"/&gt;&lt;/span&gt;&lt;/li&gt;&lt;br /&gt;				&lt;li&gt;&lt;ul&gt;&lt;br /&gt;				  &lt;xsl:apply-templates select="outline"&gt;&lt;xsl:sort select="@text"/&gt;&lt;/xsl:apply-templates&gt;&lt;br /&gt;				&lt;/ul&gt;&lt;br /&gt;				&lt;/li&gt;&lt;br /&gt;			&lt;/xsl:when&gt;&lt;br /&gt;			&lt;xsl:otherwise&gt;&lt;br /&gt;			        &lt;li&gt;&lt;br /&gt;				  &lt;span style="font-weight:900"&gt;&lt;br /&gt;				    &lt;xsl:value-of select="@text"/&gt;&lt;br /&gt;				  &lt;/span&gt;&lt;br /&gt;				[&lt;a href="{@xmlUrl}"&gt;xml&lt;/a&gt;&lt;br /&gt;				&lt;xsl:choose&gt;&lt;br /&gt;					&lt;xsl:when test="starts-with(@htmlUrl,'http')"&gt;|&lt;a href="{@htmlUrl}"&gt;www&lt;/a&gt;&lt;br /&gt;					&lt;/xsl:when&gt;&lt;br /&gt;				&lt;/xsl:choose&gt;]&lt;br /&gt;				&lt;xsl:choose&gt;&lt;br /&gt;				    &lt;xsl:when test="string-length(@description)"&gt;&lt;br /&gt;				      &lt;span style="margin-left: 10px;"&gt;(&lt;xsl:value-of select="@description"/&gt;)&lt;/span&gt;&lt;br /&gt;				    &lt;/xsl:when&gt;&lt;br /&gt;				&lt;/xsl:choose&gt;&lt;br /&gt;				&lt;/li&gt;&lt;br /&gt;			&lt;/xsl:otherwise&gt;&lt;br /&gt;		&lt;/xsl:choose&gt;&lt;br /&gt;	&lt;/xsl:template&gt;&lt;br /&gt;&lt;br /&gt;&lt;/xsl:stylesheet&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 09 Mar 2007 23:50:35 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3653</guid>
      <author>jasonbentley (Jason Bentley)</author>
    </item>
  </channel>
</rss>
