logo

blog

My little blog can’t be this cute!

bookmarks.xsl (1705B)


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xml:space="preserve">
  3. <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
  4. <xsl:template match="/xbel"><xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
  5. <html xml:lang="en" lang="en">
  6. <head>
  7. <xsl:comment>#include file="/templates/head.shtml" </xsl:comment>
  8. <title>Bookmarks - lanodan's cyber-home</title>
  9. </head>
  10. <body class="inline-sections">
  11. <xsl:comment>#include file="/templates/en/nav.shtml" </xsl:comment>
  12. <h1>Bookmarks</h1>
  13. <p>This is generated from <a href="/bookmarks.xbel">/bookmarks.xbel</a>, a standard-compliant <a href="http://pyxml.sourceforge.net/topics/xbel/">XBEL</a> file, which you can process and import in some browsers. (XSLT file used for it: <a href="/bookmarks.xsl">/bookmarks.xsl</a>)</p><xsl:apply-templates select="/xbel/folder"/>
  14. <section id="Misc">
  15. <h2><a href="#Misc">§</a> Misc</h2>
  16. <ul><xsl:apply-templates select="/xbel/bookmark"/>
  17. </ul>
  18. </section>
  19. <xsl:comment>#include file="/templates/en/footer.shtml" </xsl:comment>
  20. </body>
  21. </html></xsl:template>
  22. <xsl:template match="folder">
  23. <section id="{title}">
  24. <h2><a href="#{title}">§</a>&#x0020;<xsl:value-of select="title" /></h2>
  25. <xsl:if test="desc"><p><xsl:value-of select="desc" /></p>
  26. </xsl:if><ul><xsl:apply-templates select="bookmark"/>
  27. </ul>
  28. </section></xsl:template>
  29. <xsl:template match="bookmark">
  30. <li><a href="{@href}"><xsl:value-of select="title" /></a><xsl:if test="desc">: <xsl:value-of select="desc" /></xsl:if></li></xsl:template>
  31. </xsl:stylesheet>