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:value-of select="$target"/><xsl:text>-images-</xsl:text><xsl:value-of select="$role"/><xsl:text> = </xsl:text>
29 <xsl:for-each select="//mediaobject/imageobject[@role=$role]">
30 <xsl:value-of select="imagedata/@fileref"/>
31 <xsl:text> </xsl:text>
33 <xsl:text> </xsl:text>
36 <xsl:template name="generate-txt-chunks">
37 <xsl:value-of select="$target"/><xsl:text>-txt-chunks: </xsl:text>
38 <xsl:for-each select="(//chapter|//preface|//appendix)[@id]|book">
39 <xsl:value-of select="$txtbasedir"/>
41 <xsl:when test="name() = 'book'">
42 <xsl:text>index</xsl:text>
44 <xsl:when test="@id != ''">
45 <xsl:value-of select="@id"/>
48 <xsl:text>.txt </xsl:text>
50 <xsl:text> </xsl:text>