summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-12-27 10:23:20 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-12-27 10:29:47 +0100
commit2d803d2df11433f8d1be8d0c808420f0670b5f56 (patch)
tree57b415148c0bf4f3176c743484d2b9c179194a5c
parent4e276dcf45ea0491fbf31284941f3b5c91eeae16 (diff)
downloadmutti-web-2d803d2df11433f8d1be8d0c808420f0670b5f56.tar.gz
mutti-web-2d803d2df11433f8d1be8d0c808420f0670b5f56.tar.bz2
mutti-web-2d803d2df11433f8d1be8d0c808420f0670b5f56.zip
Parse filenames from main.xml in Makefile using xsl
-rw-r--r--Makefile3
-rw-r--r--xsl/main_filenames.xsl16
2 files changed, 18 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 710c431..562d87d 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,8 @@ xsltproc=xsltproc --stringparam suffix $(suffix)
svg2png=rsvg-convert -f png
#pages=$(shell xmllint --xpath "//*/@filename" main.xml | sed 's/filename=//g'| xargs echo)
-pages=$(shell sed -n 's/^.*filename="\([^"]*\)".*/\1/p' main.xml)
+#pages=$(shell sed -n 's/^.*filename="\([^"]*\)".*/\1/p' main.xml)
+pages=$(shell xsltproc xsl/main_filenames.xsl main.xml)
pages_gen=$(pages:%.xml=%$(suffix))
diff --git a/xsl/main_filenames.xsl b/xsl/main_filenames.xsl
new file mode 100644
index 0000000..3d80d81
--- /dev/null
+++ b/xsl/main_filenames.xsl
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+ xmlns:s="https://beratung-franzke.de/web-tpl">
+
+ <xsl:output method="text" encoding="UTF-8" />
+ <xsl:strip-space elements="*"/>
+
+ <xsl:template match="s:page">
+ <xsl:value-of select="@filename"/>
+ <xsl:text> </xsl:text>
+ </xsl:template>
+
+ <xsl:template match="/">
+ <xsl:apply-templates match="//s:page"/>
+ </xsl:template>
+</xsl:stylesheet>