Skip to content

Instantly share code, notes, and snippets.

@echohn echohn/Bookmarks.xslt
Last active Jul 22, 2016

Embed
What would you like to do?
safari auto backup bookmarks xslt file
<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output method='html' version='1.0' encoding='UTF-8' indent='yes'/>
<xsl:template match="plist">
<HTML>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" />
<Title>书签</Title>
<H1>书签</H1>
<DL>
<xsl:apply-templates/>
</DL>
</HTML>
</xsl:template>
<xsl:template match="dict">
<xsl:variable name="title" select="string[preceding-sibling::key[text() = 'Title']]"/>
<xsl:if test="not($title = '')">
<DT>
<H3 FOLDED=""><xsl:value-of select="$title"/></H3>
</DT>
</xsl:if>
<DL><p/>
<xsl:apply-templates select="array"/>
</DL><p/>
</xsl:template>
<xsl:template match="dict[key[text() = 'URIDictionary']]">
<DT>
<a href="{string[preceding-sibling::key[text() = 'URLString']]}"><xsl:value-of select="dict[preceding-sibling::key[text() = 'URIDictionary']]/string[preceding-sibling::key[text() = 'title']]"/></a>
</DT>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.