logo

blog

My little blog can’t be this cute! git clone https://hacktivis.me/git/blog.git

bookmarks.xsl (1874B)


  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" xmlns:xi="http://www.w3.org/2001/XInclude" xml:space="preserve">
  3. <xsl:import href="templates/en/nav.xsl" />
  4. <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
  5. <xsl:template match="/xbel"><xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>
  6. <html xml:lang="en" lang="en">
  7. <head>
  8. <xi:include href="templates/head.xml" parse="xml" xpointer="xpointer(/xml/*)"/>
  9. <title>Bookmarks - lanodan's cyber-home</title>
  10. </head>
  11. <body>
  12. <xsl:call-template name="nav"/>
  13. <main>
  14. <h1>Bookmarks</h1>
  15. <p>
  16. 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>).<br />
  17. It currently contains <xsl:number value="count(//bookmark)"/> links.
  18. </p><xsl:apply-templates select="/xbel/folder"/>
  19. <section id="Misc">
  20. <h2>Misc <a href="#Misc">§</a></h2>
  21. <dl><xsl:apply-templates select="/xbel/bookmark"/>
  22. </dl>
  23. </section>
  24. </main>
  25. <xi:include href="templates/en/footer.shtml" parse="xml"/>
  26. </body>
  27. </html></xsl:template>
  28. <xsl:template match="folder">
  29. <section id="{title}">
  30. <h2><xsl:value-of select="title" />&#x0020;<a href="#{title}">§</a></h2>
  31. <xsl:if test="desc"><p><xsl:value-of select="desc" /></p>
  32. </xsl:if><dl><xsl:apply-templates select="bookmark"/>
  33. </dl>
  34. </section></xsl:template>
  35. <xsl:template match="bookmark">
  36. <dt><a rel="external noreferrer" href="{@href}"><xsl:value-of select="title" /></a></dt><xsl:if test="desc"><dd><xsl:value-of select="desc" /></dd></xsl:if></xsl:template>
  37. </xsl:stylesheet>