<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE stylesheet [
<!ENTITY raquo  "&#187;" >
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	
<xsl:output method="html" 
	    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" 
	    encoding="UTF-8"/> 

<xsl:template match="delicious">

  <html>
    <head>
      <title>The-Forgotten.org &raquo; Del.ico.us WebLinks v0.5</title>

      <xsl:element name="link">
	<xsl:attribute name="href">
	  <xsl:text>http://del.icio.us/rss/mbond</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="rel">
	  <xsl:text>alternate</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="title">
	  <xsl:text>RSS</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="type">
	  <xsl:text>application/rss+xml</xsl:text>
	</xsl:attribute>
      </xsl:element>
      
      <xsl:element name="script">
	<xsl:attribute name="type">
	  <xsl:text>text/javascript</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="src">
	  <xsl:text>http://links.the-forgotten.org/bookmarks.js</xsl:text>
	</xsl:attribute>
      </xsl:element>

      <xsl:element name="style">
	<xsl:attribute name="type">
	  <xsl:text>text/css</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="media">
	  <xsl:text>all</xsl:text>
	</xsl:attribute>
	<xsl:text>@import url(http://www.the-forgotten.org/wp-content/themes/washme-inverted-10/style.css);</xsl:text>
      </xsl:element>

	<!-- Font sizes differ on windows and mac, this fixes a couple problems that result -->
	<script type="text/javascript" src="/javascript/winFox.jswinfox."></script>

    </head>

	<body>

		<div id="page">
		<div id="header">

			<img src="/wp-content/themes/washme-inverted-10/tfo.gif"/>

		</div>
			<div id="content" class="narrowcolumn">

				<div class="post-date">
					<span class="day">:-P</span>
					<span class="month">Del.icio.us</span>
					<span class="year">Bookmarks</span>
				</div>
				<div class="post-top"></div>
				<div class="post">
				<xsl:call-template name="displayPosts">
				</xsl:call-template>
			</div>
			<div class="post-bottom"></div>
			
				<div class="navigation">
					<div class="alignleft"></div>
					<div class="alignright"></div>
				</div>


			</div>


			<div id="sidebar-top">
			</div>
			<div id="sidebar">
				<ul id="linksSidebar">
				<li>
					<a href="http://www.the-forgotten.org/">Home</a>
					<br /><br />
				</li>
				<li>
					<input type="checkbox" onclick="showAll(this)" style="display: inline; margin-right: .5em;"/> Show All
				</li>

				<xsl:call-template name="displayBundles">
				</xsl:call-template>

				<li>
					<h2>Tags</h2>
				</li>

				<xsl:call-template name="displayTags">
				</xsl:call-template>
			</ul>
			</div>
			<div id="sidebar-bottom"></div>

		</div>
		
		<div id="footer">
			<p class="first">
			</p>
			<p class="second">

			</p>

		</div>

	</body>
    
  </html>

</xsl:template>

<xsl:template name="displayTags">
  <xsl:for-each select="tags/tag">
    <xsl:sort order="ascending" select="@tag" case-order="upper-first" />

    <li class="catFontSize">
		<xsl:element name="input">
			<xsl:attribute name="type">
				<xsl:text>checkbox</xsl:text>
			</xsl:attribute>
			<xsl:attribute name="name">
				<xsl:value-of select="@tag" />
			</xsl:attribute>
			<xsl:attribute name="onclick">
				<xsl:text>cat_update(this)</xsl:text>
			</xsl:attribute>
			<xsl:attribute name="style">
				<xsl:text>display: inline; margin-right: .5em;</xsl:text>
			</xsl:attribute>
		</xsl:element>
		
		<xsl:value-of select="@tag" />
	</li>

  </xsl:for-each>
</xsl:template>

<xsl:template name="displayPosts">

  <xsl:for-each select="posts/post">

    <xsl:sort order="ascending" select="@description" case-order="upper-first" />

    <xsl:element name="div">

      <xsl:attribute name="class">
	<xsl:text>item </xsl:text>
	<xsl:value-of select="@tag" />
      </xsl:attribute>

      <xsl:text>[</xsl:text>
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:text>http://del.icio.us/</xsl:text>
	  <xsl:value-of select="//delicious/posts/@user" />
	  <xsl:text>?url=</xsl:text>
	  <xsl:value-of select="@href" />
	  <xsl:text>&amp;jump=no</xsl:text>
	</xsl:attribute>
	<xsl:text>edit</xsl:text>
      </xsl:element>
      <xsl:text>] </xsl:text>
      
      <xsl:element name="a">
	<xsl:attribute name="href">
	  <xsl:value-of select="@href" />
	</xsl:attribute>
	
	<xsl:value-of select="@description" />
	
      </xsl:element>
      
    </xsl:element>
    
  </xsl:for-each>

</xsl:template>

<xsl:template name="displayBundles">

  <xsl:for-each select="bundles/bundle">

    <li>
		<h2><xsl:value-of select="@name" /></h2>

    </li>

    <xsl:call-template name="split">
      <xsl:with-param name="tags" select="@tags" />
    </xsl:call-template>

  </xsl:for-each>

</xsl:template>

<xsl:template name="split">
  <xsl:param name="tags" />
  <xsl:variable name="firstSplit" select='substring-before($tags," ")' />
  <xsl:variable name="rest" select='substring-after($tags," ")' />

  <xsl:if test='$firstSplit'>
    <li  class="catFontSize">
      <xsl:element name="input">
	<xsl:attribute name="type">
	  <xsl:text>checkbox</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="name">
	  <xsl:value-of select="$firstSplit" />
	</xsl:attribute>
	<xsl:attribute name="onclick">
	  <xsl:text>cat_update(this)</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="style">
		<xsl:text>display: inline; margin-right: .5em;</xsl:text>
	</xsl:attribute>
      </xsl:element>

      <xsl:value-of select='$firstSplit' />
    </li>
  </xsl:if>

  <xsl:if test='$rest'>
    <xsl:call-template name='split'>
      <xsl:with-param name='tags' select='$rest' />
    </xsl:call-template>
  </xsl:if>

  <xsl:if test='not($rest)'>
    <li  class="catFontSize">
      <xsl:element name="input">
	<xsl:attribute name="type">
	  <xsl:text>checkbox</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="name">
	  <xsl:value-of select="$tags" />
	</xsl:attribute>
	<xsl:attribute name="onclick">
	  <xsl:text>cat_update(this)</xsl:text>
	</xsl:attribute>
	<xsl:attribute name="style">
		<xsl:text>display: inline; margin-right: .5em;</xsl:text>
	</xsl:attribute>
      </xsl:element>

      <xsl:value-of select='$tags' />
    </li>
  </xsl:if>

</xsl:template>

</xsl:stylesheet>
