source: stylesheets/xhtml/lfs-titles.xsl@ 332ba21

6.0
Last change on this file since 332ba21 was c0be107, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Making a proper English punctuation for xref elemments (HTML output). See chapter05/gettext.xml for a tagging example.

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4099 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.9 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns="http://www.w3.org/1999/xhtml"
5 version="1.0">
6
7 <xsl:template name="part.titlepage">
8 <div class="titlepage">
9 <h1 class="{name(.)}">
10 <xsl:apply-templates select="." mode="label.markup"/>
11 <xsl:text>. </xsl:text>
12 <xsl:value-of select="title"/>
13 </h1>
14 </div>
15 </xsl:template>
16
17 <xsl:template name="chapter.titlepage">
18 <div class="titlepage">
19 <h1 class="{name(.)}">
20 <xsl:apply-templates select="." mode="label.markup"/>
21 <xsl:text>. </xsl:text>
22 <xsl:value-of select="title"/>
23 </h1>
24 </div>
25 </xsl:template>
26
27 <xsl:template name="preface.titlepage">
28 <div class="titlepage">
29 <h1 class="{name(.)}">
30 <xsl:value-of select="title"/>
31 </h1>
32 </div>
33 </xsl:template>
34
35 <xsl:template name="sect1.titlepage">
36 <xsl:choose>
37 <!-- I should find a better test -->
38 <xsl:when test="position() = 4">
39 <div class="titlepage">
40 <xsl:if test="@id">
41 <a id="{@id}" name="{@id}"/>
42 </xsl:if>
43 <h2 class="{name(.)}">
44 <xsl:apply-templates select="." mode="label.markup"/>
45 <xsl:text>. </xsl:text>
46 <xsl:value-of select="title"/>
47 </h2>
48 </div>
49 </xsl:when>
50 <xsl:otherwise>
51 <div class="titlepage">
52 <h1 class="{name(.)}">
53 <xsl:apply-templates select="." mode="label.markup"/>
54 <xsl:text>. </xsl:text>
55 <xsl:value-of select="title"/>
56 </h1>
57 </div>
58 </xsl:otherwise>
59 </xsl:choose>
60 </xsl:template>
61
62 <xsl:template name="sect2.titlepage">
63 <xsl:choose>
64 <xsl:when test="string-length(title) = 0"/>
65 <xsl:otherwise>
66 <div class="titlepage">
67 <xsl:if test="@id">
68 <a id="{@id}" name="{@id}"/>
69 </xsl:if>
70 <h2 class="{name(.)}">
71 <xsl:apply-templates select="." mode="label.markup"/>
72 <xsl:text>. </xsl:text>
73 <xsl:value-of select="title"/>
74 </h2>
75 </div>
76 </xsl:otherwise>
77 </xsl:choose>
78 </xsl:template>
79
80 <xsl:template name="dedication.titlepage">
81 <div class="titlepage">
82 <h2 class="{name(.)}">
83 <xsl:value-of select="title"/>
84 </h2>
85 </div>
86 </xsl:template>
87
88 <!-- Harcoded a period for proper punctuation in xrefs. -->
89 <xsl:template match="*" mode="insert.title.markup">
90 <xsl:param name="purpose"/>
91 <xsl:param name="xrefstyle"/>
92 <xsl:param name="title"/>
93 <xsl:param name="role"/>
94 <xsl:choose>
95 <xsl:when test="$purpose = 'xref' and titleabbrev">
96 <xsl:apply-templates select="." mode="titleabbrev.markup"/>
97 </xsl:when>
98 <xsl:otherwise>
99 <xsl:copy-of select="$title"/>
100 <xsl:value-of select="$role"/>
101 </xsl:otherwise>
102 </xsl:choose>
103 </xsl:template>
104
105</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.