summaryrefslogtreecommitdiff
path: root/docs/xslt
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-03-16 15:33:49 +0000
committerGerald W. Carter <jerry@samba.org>2008-04-23 08:46:22 -0500
commitf3b558e782258c362c34cc0e45570955ebf0e5a0 (patch)
treed81cace1a39b8f09125451bebb8c174eb0dd1fef /docs/xslt
parent8c41033595f57136f47dc6b268b92e83077414d4 (diff)
downloadsamba-f3b558e782258c362c34cc0e45570955ebf0e5a0.tar.gz
samba-f3b558e782258c362c34cc0e45570955ebf0e5a0.tar.bz2
samba-f3b558e782258c362c34cc0e45570955ebf0e5a0.zip
Add xslt script that can generate dependency makefiles
(This used to be commit 59730e1280e46c5e0dbae8ca7e52cd192496ea9e)
Diffstat (limited to 'docs/xslt')
-rw-r--r--docs/xslt/generate-dependencies.xsl52
1 files changed, 52 insertions, 0 deletions
diff --git a/docs/xslt/generate-dependencies.xsl b/docs/xslt/generate-dependencies.xsl
new file mode 100644
index 0000000000..37e03f08d1
--- /dev/null
+++ b/docs/xslt/generate-dependencies.xsl
@@ -0,0 +1,52 @@
+<?xml version='1.0'?>
+<!--
+ Find the image dependencies of a certain XML file
+ Generates (part of) a Makefile
+
+ - $(FNAME)-images-latex-{png,dvi} for role=latex
+ - $(FNAME)-images-role for all other roles
+ - $(TXTDIR)/$(FNAME)-text
+
+ (C) Jelmer Vernooij 2004-2005
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
+ <xsl:output method="text"/>
+
+ <xsl:template match="/">
+ <xsl:for-each select="//mediaobject/imageobject[@role and not(@role=following::imageobject/@role)]">
+ <xsl:call-template name="generate-images">
+ <xsl:with-param name="role"><xsl:value-of select="@role"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:call-template name="generate-images">
+ <xsl:with-param name="role"/>
+ </xsl:call-template>
+ <xsl:call-template name="generate-txt-chunks"/>
+ </xsl:template>
+
+ <xsl:template name="generate-images">
+ <xsl:value-of select="$target"/><xsl:text>-images-</xsl:text><xsl:value-of select="$role"/><xsl:text> = </xsl:text>
+ <xsl:for-each select="//mediaobject/imageobject[@role=$role]">
+ <xsl:value-of select="imagedata/@fileref"/>
+ <xsl:text> </xsl:text>
+ </xsl:for-each>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:template>
+
+ <xsl:template name="generate-txt-chunks">
+ <xsl:value-of select="$target"/><xsl:text>-txt-chunks: </xsl:text>
+ <xsl:for-each select="(//chapter|//preface|//appendix)[@id]|book">
+ <xsl:value-of select="$txtbasedir"/>
+ <xsl:choose>
+ <xsl:when test="name() = 'book'">
+ <xsl:text>index</xsl:text>
+ </xsl:when>
+ <xsl:when test="@id != ''">
+ <xsl:value-of select="@id"/>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:text>.txt </xsl:text>
+ </xsl:for-each>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:template>
+</xsl:stylesheet>