2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 <xsl:param name=
"filename-prefix" select=
"''"/>
6 <xsl:param name=
"output-root" select=
"''"/>
8 <xsl:output method=
"text"/>
10 <xsl:template match=
"autolayout">
11 <xsl:text>website:
</xsl:text>
12 <xsl:apply-templates select=
"toc" mode=
"all"/>
13 <xsl:apply-templates select=
"notoc" mode=
"all"/>
14 <xsl:text> </xsl:text>
15 <xsl:apply-templates select=
"toc"/>
16 <xsl:apply-templates select=
"notoc"/>
17 <xsl:text> </xsl:text>
18 <xsl:text>distclean: clean
20 <xsl:text>depends.tabular
</xsl:text>
21 <xsl:text> </xsl:text>
24 <xsl:template match=
"toc">
26 <xsl:apply-templates select="." mode="calculate-dir"/>
28 <xsl:call-template name=
"output-root"/>
29 <xsl:value-of select=
"@dir"/>
30 <xsl:value-of select=
"$filename-prefix"/>
31 <xsl:value-of select=
"@filename"/>
32 <xsl:text>:
</xsl:text>
33 <xsl:value-of select=
"@page"/>
34 <xsl:text> </xsl:text>
35 <xsl:apply-templates select=
".//tocentry"/>
38 <xsl:template match=
"tocentry|notoc">
40 <xsl:apply-templates select="." mode="calculate-dir"/>
42 <xsl:if test=
"@filename">
43 <xsl:call-template name=
"output-root"/>
44 <xsl:value-of select=
"@dir"/>
45 <xsl:value-of select=
"$filename-prefix"/>
46 <xsl:value-of select=
"@filename"/>
47 <xsl:text>:
</xsl:text>
48 <xsl:value-of select=
"@page"/>
49 <xsl:text> </xsl:text>
53 <xsl:template match=
"toc" mode=
"all">
54 <xsl:apply-templates select=
".//tocentry" mode=
"all"/>
56 <xsl:apply-templates select="." mode="calculate-dir"/>
58 <xsl:call-template name=
"output-root"/>
59 <xsl:value-of select=
"@dir"/>
60 <xsl:value-of select=
"$filename-prefix"/>
61 <xsl:value-of select=
"@filename"/>
62 <xsl:text> </xsl:text>
65 <xsl:template match=
"tocentry|notoc" mode=
"all">
67 <xsl:apply-templates select="." mode="calculate-dir"/>
69 <xsl:if test=
"@filename">
70 <xsl:call-template name=
"output-root"/>
71 <xsl:value-of select=
"@dir"/>
72 <xsl:value-of select=
"$filename-prefix"/>
73 <xsl:value-of select=
"@filename"/>
74 <xsl:text> </xsl:text>
78 <xsl:template match=
"*" mode=
"calculate-dir">
80 <xsl:when test=
"starts-with(@dir, '/')">
81 <!-- if the directory on this begins with a "/", we're done... -->
82 <xsl:value-of select=
"substring-after(@dir, '/')"/>
84 <xsl:if test="@dir != '/'">
85 <xsl:text>/</xsl:text>
90 <xsl:when test=
"parent::*">
91 <!-- if there's a parent, try it -->
92 <xsl:apply-templates select=
"parent::*" mode=
"calculate-dir"/>
94 <xsl:value-of select=
"@dir"/>
96 <xsl:text>/</xsl:text>
103 <xsl:value-of select=
"@dir"/>
105 <xsl:text>/</xsl:text>
112 <xsl:template name=
"output-root">
113 <xsl:if test=
"$output-root != ''">
114 <xsl:value-of select=
"$output-root"/>
115 <xsl:text>/
</xsl:text>