Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/tools/boostbook/xsl/chunk-common.xsl @ 29

Last change on this file since 29 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 3.5 KB
Line 
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<xsl:import
14    href="http://docbook.sourceforge.net/release/xsl/current/html/chunk-common.xsl"/>
15
16<xsl:import href="relative-href.xsl"/>
17
18<!-- ==================================================================== -->
19
20<xsl:template match="*" mode="recursive-chunk-filename">
21    <xsl:param name="recursive" select="false()"/>
22
23    <xsl:variable name="their">
24        <xsl:apply-imports mode="recursive-chunk-filename" select="."/>
25    </xsl:variable>
26
27    <xsl:variable name="basename" select="substring-before( $their, $html.ext )"/>
28    <xsl:choose>
29        <xsl:when test="not($recursive)">
30            <xsl:value-of select="translate( $basename, '.', '/' )"/>
31            <xsl:value-of select="$html.ext"/>
32        </xsl:when>
33        <xsl:otherwise>
34            <xsl:value-of select="$basename"/>
35            <xsl:value-of select="'.'"/>
36        </xsl:otherwise>
37    </xsl:choose>
38
39</xsl:template>
40
41<!-- ==================================================================== -->
42
43<xsl:template name="navig.content">
44    <xsl:param name="direction" select="next"/>
45    <xsl:variable name="navtext">
46        <xsl:choose>
47            <xsl:when test="$direction = 'prev'">
48                <xsl:call-template name="gentext.nav.prev"/>
49            </xsl:when>
50            <xsl:when test="$direction = 'next'">
51                <xsl:call-template name="gentext.nav.next"/>
52            </xsl:when>
53            <xsl:when test="$direction = 'up'">
54                <xsl:call-template name="gentext.nav.up"/>
55            </xsl:when>
56            <xsl:when test="$direction = 'home'">
57                <xsl:call-template name="gentext.nav.home"/>
58            </xsl:when>
59            <xsl:otherwise>
60                <xsl:text>xxx</xsl:text>
61            </xsl:otherwise>
62        </xsl:choose>
63    </xsl:variable>
64
65    <xsl:choose>
66        <xsl:when test="$navig.graphics != 0">
67            <img>
68                <xsl:attribute name="src">
69            <xsl:call-template name="href.target.relative">
70                <xsl:with-param name="target" select="$navig.graphics.path"/>
71            </xsl:call-template>
72                    <xsl:value-of select="$direction"/>
73                    <xsl:value-of select="$navig.graphics.extension"/>
74                </xsl:attribute>
75                <xsl:attribute name="alt">
76                    <xsl:value-of select="$navtext"/>
77                </xsl:attribute>
78            </img>
79        </xsl:when>
80        <xsl:otherwise>
81            <xsl:value-of select="$navtext"/>
82        </xsl:otherwise>
83    </xsl:choose>
84</xsl:template>
85
86
87<!-- ====================================================================== -->
88
89<xsl:template match="@fileref">
90    <xsl:choose>
91        <xsl:when test="contains(., ':')">
92            <xsl:value-of select="."/>
93        </xsl:when>
94        <xsl:otherwise>
95            <xsl:call-template name="href.target.relative">
96                <xsl:with-param name="target" select="."/>
97                <xsl:with-param name="context" select=".."/>
98            </xsl:call-template>
99        </xsl:otherwise>
100    </xsl:choose>
101</xsl:template>
102
103
104<xsl:template match="@url">
105    <xsl:choose>
106        <xsl:when test="contains(., ':')">
107            <xsl:value-of select="."/>
108        </xsl:when>
109        <xsl:otherwise>
110            <xsl:text>XXX</xsl:text>
111            <xsl:value-of select="."/>
112            <xsl:text>XXX</xsl:text>
113        </xsl:otherwise>
114    </xsl:choose>
115</xsl:template>
116
117
118</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.