summaryrefslogtreecommitdiff
path: root/tools/xml-notes-dump.xsl
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2018-05-01 06:10:19 +0300
committerdefanor <defanor@uberspace.net>2018-05-01 06:10:19 +0300
commit56c57f94738efab8b0bf83dc68480931a2ceee00 (patch)
tree30663a142eedd52670a68e26885cff6348a45d3f /tools/xml-notes-dump.xsl
parente0b97e0e2168c4d2b9cf60b16e81591f912c2f4a (diff)
Focus on source XML manipulation, introduce indexes
Instead of XHTML or Atom, so resulting files get generated out of custom XML structures now. This was needed to get indexes that won't depend on Atom (and to avoid the duplication). Now indexes can be included with something like the following: <notes xmlns="" number="5" src="../build/notes-by-modification-date.xml" />
Diffstat (limited to 'tools/xml-notes-dump.xsl')
-rw-r--r--tools/xml-notes-dump.xsl26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/xml-notes-dump.xsl b/tools/xml-notes-dump.xsl
new file mode 100644
index 0000000..79b9606
--- /dev/null
+++ b/tools/xml-notes-dump.xsl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+ <xsl:output method="xml" indent="yes"/>
+
+ <xsl:template match="note">
+ <xsl:variable name="docPath">
+ <xsl:text>../src/</xsl:text>
+ <xsl:value-of select="@src" />
+ </xsl:variable>
+ <xsl:variable name="doc" select="document($docPath)" />
+ <xsl:copy>
+ <xsl:copy-of select="@*" />
+ <xsl:copy-of select="$doc" />
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="node()" priority="0">
+ <xsl:copy>
+ <xsl:copy-of select="@*" />
+ <xsl:apply-templates />
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>