• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0"?>
2<!--
3   Copyright (c) 2002 Douglas Gregor <doug.gregor -at- gmail.com>
4
5   Distributed under the Boost Software License, Version 1.0.
6   (See accompanying file LICENSE_1_0.txt or copy at
7   http://www.boost.org/LICENSE_1_0.txt)
8  -->
9<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10                version="1.0">
11
12<!-- Import the HTML chunking stylesheet -->
13
14<!-- Watch out that we don't override chunk.xsl -->
15<!--
16<xsl:import
17    href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/> -->
18
19<!-- Already included in the main stylesheet -->
20<!-- <xsl:import href="relative-href.xsl"/> -->
21
22<!-- ==================================================================== -->
23
24<xsl:template match="*" mode="recursive-chunk-filename">
25    <xsl:param name="recursive" select="false()"/>
26
27    <xsl:variable name="their">
28        <xsl:apply-imports mode="recursive-chunk-filename" select="."/>
29    </xsl:variable>
30
31    <xsl:variable name="basename" select="substring-before( $their, $html.ext )"/>
32    <xsl:choose>
33        <xsl:when test="not($recursive)">
34            <!-- translate dots into directory separators, and replace illegal file path characters with underscores -->
35            <xsl:value-of select="translate($basename, '.&lt;&gt;\:*?&quot;|,()!+=&amp;', '/_______________' )"/>
36            <xsl:value-of select="$html.ext"/>
37        </xsl:when>
38        <xsl:otherwise>
39            <xsl:value-of select="$basename"/>
40            <xsl:value-of select="'.'"/>
41        </xsl:otherwise>
42    </xsl:choose>
43
44</xsl:template>
45
46<!-- ==================================================================== -->
47
48<xsl:template name="navig.content">
49    <xsl:param name="direction" select="next"/>
50    <xsl:variable name="navtext">
51        <xsl:choose>
52	    <xsl:when test="$direction = 'prev'">
53    		<xsl:call-template name="gentext.nav.prev"/>
54	    </xsl:when>
55	    <xsl:when test="$direction = 'next'">
56    		<xsl:call-template name="gentext.nav.next"/>
57	    </xsl:when>
58	    <xsl:when test="$direction = 'up'">
59    		<xsl:call-template name="gentext.nav.up"/>
60	    </xsl:when>
61	    <xsl:when test="$direction = 'home'">
62    		<xsl:call-template name="gentext.nav.home"/>
63	    </xsl:when>
64	    <xsl:otherwise>
65    		<xsl:text>xxx</xsl:text>
66	    </xsl:otherwise>
67	</xsl:choose>
68    </xsl:variable>
69
70    <xsl:choose>
71    <xsl:when test="$navtext = 'xxx'">
72        <xsl:value-of select="$direction"/>
73    </xsl:when>
74	<xsl:when test="$navig.graphics != 0">
75	    <img>
76		<xsl:attribute name="src">
77            <xsl:call-template name="href.target.relative">
78                <xsl:with-param name="target" select="$navig.graphics.path"/>
79            </xsl:call-template>
80		    <xsl:value-of select="$direction"/>
81		    <xsl:value-of select="$navig.graphics.extension"/>
82		</xsl:attribute>
83		<xsl:attribute name="alt">
84		    <xsl:value-of select="$navtext"/>
85		</xsl:attribute>
86	    </img>
87	</xsl:when>
88	<xsl:otherwise>
89	    <xsl:value-of select="$navtext"/>
90	</xsl:otherwise>
91    </xsl:choose>
92</xsl:template>
93
94
95<!-- ====================================================================== -->
96
97<xsl:template match="@fileref">
98    <xsl:choose>
99        <xsl:when test="contains(., ':')">
100            <xsl:value-of select="."/>
101        </xsl:when>
102        <xsl:otherwise>
103            <xsl:call-template name="href.target.relative">
104                <xsl:with-param name="target" select="."/>
105                <xsl:with-param name="context" select=".."/>
106            </xsl:call-template>
107        </xsl:otherwise>
108    </xsl:choose>
109</xsl:template>
110
111
112<xsl:template match="@url">
113    <xsl:choose>
114        <xsl:when test="contains(., ':')">
115            <xsl:value-of select="."/>
116        </xsl:when>
117        <xsl:otherwise>
118            <xsl:text>XXX</xsl:text>
119            <xsl:value-of select="."/>
120            <xsl:text>XXX</xsl:text>
121        </xsl:otherwise>
122    </xsl:choose>
123</xsl:template>
124
125
126</xsl:stylesheet>
127