3 Find the image dependencies of a certain XML file
4 Generates (part of) a Makefile
6 - $(FNAME)-images-latex-{png,dvi} for role=latex
7 - $(FNAME)-images-role for all other roles
8 - $(TXTDIR)/$(FNAME)-text
10 (C) Jelmer Vernooij 2004-2005
12 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">
13 <xsl:output method="text"/>
15 <xsl:template match="/">
16 <xsl:for-each select="//mediaobject/imageobject[@role and not(@role=following::imageobject/@role)]">
17 <xsl:call-template name="generate-images">
18 <xsl:with-param name="role"><xsl:value-of select="@role"/></xsl:with-param>
21 <xsl:call-template name="generate-images">
22 <xsl:with-param name="role"/>
24 <xsl:call-template name="generate-txt-chunks"/>
27 <xsl:template name="generate-images">
28 <xsl:param name="role"/>
29 <xsl:value-of select="$target"/><xsl:text>-images-</xsl:text><xsl:value-of select="$role"/><xsl:text> = </xsl:text>
30 <xsl:for-each select="//mediaobject/imageobject[@role=$role]">
31 <xsl:value-of select="imagedata/@fileref"/>
32 <xsl:text> </xsl:text>
34 <xsl:text> </xsl:text>
37 <xsl:template name="generate-txt-chunks">
38 <xsl:value-of select="$target"/><xsl:text>-txt-chunks: </xsl:text>
39 <xsl:for-each select="(//chapter|//preface|//appendix)[@id]|book">
40 <xsl:value-of select="$txtbasedir"/>
42 <xsl:when test="name() = 'book'">
43 <xsl:text>index</xsl:text>
45 <xsl:when test="@id != ''">
46 <xsl:value-of select="@id"/>
49 <xsl:text>.txt </xsl:text>
51 <xsl:text> </xsl:text>