diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-12-07 07:00:08 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-12-07 07:00:08 +0800 |
commit | 258fa23beaa5c6096dcd2081ccc5f3fa1e6e6f1e (patch) | |
tree | 0501dae900c657a595512dcfbaeeb452f55fb020 /data/epiphany-bookmarks-html.xsl | |
parent | 7d41f0ac49c67d18ff6852f92f730c0929852790 (diff) | |
download | gsoc2013-epiphany-258fa23beaa5c6096dcd2081ccc5f3fa1e6e6f1e.tar gsoc2013-epiphany-258fa23beaa5c6096dcd2081ccc5f3fa1e6e6f1e.tar.gz gsoc2013-epiphany-258fa23beaa5c6096dcd2081ccc5f3fa1e6e6f1e.tar.bz2 gsoc2013-epiphany-258fa23beaa5c6096dcd2081ccc5f3fa1e6e6f1e.tar.lz gsoc2013-epiphany-258fa23beaa5c6096dcd2081ccc5f3fa1e6e6f1e.tar.xz gsoc2013-epiphany-258fa23beaa5c6096dcd2081ccc5f3fa1e6e6f1e.tar.zst gsoc2013-epiphany-258fa23beaa5c6096dcd2081ccc5f3fa1e6e6f1e.zip |
A data/epiphany-bookmarks-html.xsl:
2004-12-06 Christian Persch <chpe@cvs.gnome.org>
* configure.ac:
* data/Makefile.am:
A data/epiphany-bookmarks-html.xsl:
* data/ui/epiphany-bookmark-editor-ui.xml:
* src/bookmarks/ephy-bookmarks-editor.c: (cmd_bookmarks_export),
(ephy_bookmarks_editor_construct):
* src/bookmarks/ephy-bookmarks-export.c: (write_rdf),
(ephy_bookmarks_export_rdf), (ephy_bookmarks_export_mozilla):
* src/bookmarks/ephy-bookmarks-export.h:
* src/ephy-main.c: (main):
Add bookmarks export to bookmarks editor. Fixes bug #157745.
Diffstat (limited to 'data/epiphany-bookmarks-html.xsl')
-rw-r--r-- | data/epiphany-bookmarks-html.xsl | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/data/epiphany-bookmarks-html.xsl b/data/epiphany-bookmarks-html.xsl new file mode 100644 index 000000000..8caac7d38 --- /dev/null +++ b/data/epiphany-bookmarks-html.xsl @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:purl="http://purl.org/rss/1.0/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + exclude-result-prefixes="dc purl rdf"> +<!-- +Copyright (C) 2004 Stefan Rotsch + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +$Id$ +--> +<xsl:output method="html" encoding="UTF-8" indent="yes" /> + +<!-- Create a key assigning an item's topic to each item --> +<xsl:key name="topics" match="purl:item" use="dc:subject" /> + +<xsl:template match="rdf:RDF"> + + <!-- Generate DTD --> + <xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE NETSCAPE-Bookmark-file-1>]]> +</xsl:text> + + <!-- Page header and title --> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> + <title>Bookmarks</title> + <h1>Bookmarks</h1> + <dl> + + <!-- Items with Topics assigned will be processed first --> + <xsl:for-each select="purl:item[count(. | key('topics', dc:subject)[1]) = 1]"> + <xsl:sort select="dc:subject" /> + + <!-- Test if a topic is assigned --> + <xsl:if test="dc:subject"> + + <dt><h3><xsl:value-of select="dc:subject" /></h3><dl> + <xsl:for-each select="key('topics', dc:subject)"> + <xsl:sort select="purl:title" /> + <dt><a href="{./purl:link}"><xsl:value-of select="./purl:title" /></a></dt> + </xsl:for-each> + + <!-- Force a linebreak; otherwise thinks will break for Topics with only 1 item --> + <xsl:text> + </xsl:text> + </dl></dt> + </xsl:if> + </xsl:for-each> + + <!-- Now Bookmarks without topics will be added at the bottom of the output file --> + <xsl:for-each select="purl:item"> + <xsl:sort select="./purl:title" /> + <xsl:if test="not(dc:subject)"> + <dt><a href="{./purl:link}"><xsl:value-of select="./purl:title" /></a></dt> + </xsl:if> + </xsl:for-each> + + <!-- Closing tag of outer dl --> + </dl> + +</xsl:template> + +</xsl:stylesheet> |