source: stylesheets/xhtml/lfs-mixed.xsl@ a0e1913

Last change on this file since a0e1913 was 4f61f8f, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Updated the multi-arch XSL files to current testing version,

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

  • Property mode set to 100644
File size: 5.1 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 <!-- screen -->
8 <xsl:template match="screen">
9 <xsl:choose>
10 <xsl:when test="child::* = userinput">
11 <pre class="userinput">
12 <xsl:apply-templates/>
13 </pre>
14 </xsl:when>
15 <xsl:otherwise>
16 <pre class="{name(.)}">
17 <xsl:apply-templates/>
18 </pre>
19 </xsl:otherwise>
20 </xsl:choose>
21 </xsl:template>
22
23 <xsl:template match="userinput">
24 <xsl:choose>
25 <xsl:when test="ancestor::screen">
26 <kbd class="command">
27 <xsl:apply-templates/>
28 </kbd>
29 </xsl:when>
30 <xsl:otherwise>
31 <xsl:apply-imports/>
32 </xsl:otherwise>
33 </xsl:choose>
34 </xsl:template>
35
36
37 <!-- variablelist -->
38 <xsl:template match="variablelist">
39 <div class="{name(.)}">
40 <xsl:if test="title | bridgehead">
41 <xsl:choose>
42 <xsl:when test="@role = 'materials'">
43 <h2>
44 <xsl:value-of select="title | bridgehead"/>
45 </h2>
46 </xsl:when>
47 <xsl:otherwise>
48 <h3>
49 <xsl:value-of select="title | bridgehead"/>
50 </h3>
51 </xsl:otherwise>
52 </xsl:choose>
53 </xsl:if>
54 <dl>
55 <xsl:if test="@role">
56 <xsl:attribute name="class">
57 <xsl:value-of select="@role"/>
58 </xsl:attribute>
59 </xsl:if>
60 <xsl:apply-templates select="varlistentry"/>
61 </dl>
62 </div>
63 </xsl:template>
64
65 <!-- Body attributes -->
66 <xsl:template name="body.attributes">
67 <xsl:attribute name="id">
68 <xsl:text>lfs</xsl:text>
69 </xsl:attribute>
70 <xsl:attribute name="class">
71 <xsl:value-of select="substring-after(/book/bookinfo/subtitle, ' ')"/>
72 </xsl:attribute>
73 </xsl:template>
74
75 <!-- External URLs in italic font -->
76 <xsl:template match="ulink" name="ulink">
77 <a>
78 <xsl:if test="@id">
79 <xsl:attribute name="id">
80 <xsl:value-of select="@id"/>
81 </xsl:attribute>
82 </xsl:if>
83 <xsl:attribute name="href"><xsl:value-of select="@url"/></xsl:attribute>
84 <i>
85 <xsl:choose>
86 <xsl:when test="count(child::node())=0">
87 <xsl:value-of select="@url"/>
88 </xsl:when>
89 <xsl:otherwise>
90 <xsl:apply-templates/>
91 </xsl:otherwise>
92 </xsl:choose>
93 </i>
94 </a>
95 </xsl:template>
96
97 <!-- The <code> xhtml tag have look issues in some browsers, like Konqueror and.
98 isn't semantically correct (a filename isn't a code fragment) We will use <tt> for now. -->
99 <xsl:template name="inline.monoseq">
100 <xsl:param name="content">
101 <xsl:call-template name="anchor"/>
102 <xsl:call-template name="simple.xlink">
103 <xsl:with-param name="content">
104 <xsl:apply-templates/>
105 </xsl:with-param>
106 </xsl:call-template>
107 </xsl:param>
108 <tt class="{local-name(.)}">
109 <xsl:if test="@dir">
110 <xsl:attribute name="dir">
111 <xsl:value-of select="@dir"/>
112 </xsl:attribute>
113 </xsl:if>
114 <xsl:copy-of select="$content"/>
115 </tt>
116 </xsl:template>
117
118 <xsl:template name="inline.boldmonoseq">
119 <xsl:param name="content">
120 <xsl:call-template name="anchor"/>
121 <xsl:call-template name="simple.xlink">
122 <xsl:with-param name="content">
123 <xsl:apply-templates/>
124 </xsl:with-param>
125 </xsl:call-template>
126 </xsl:param>
127 <!-- don't put <strong> inside figure, example, or table titles -->
128 <!-- or other titles that may already be represented with <strong>'s. -->
129 <xsl:choose>
130 <xsl:when test="local-name(..) = 'title' and (local-name(../..) = 'figure'
131 or local-name(../..) = 'example' or local-name(../..) = 'table' or local-name(../..) = 'formalpara')">
132 <tt class="{local-name(.)}">
133 <xsl:if test="@dir">
134 <xsl:attribute name="dir">
135 <xsl:value-of select="@dir"/>
136 </xsl:attribute>
137 </xsl:if>
138 <xsl:copy-of select="$content"/>
139 </tt>
140 </xsl:when>
141 <xsl:otherwise>
142 <strong class="{local-name(.)}">
143 <tt>
144 <xsl:if test="@dir">
145 <xsl:attribute name="dir">
146 <xsl:value-of select="@dir"/>
147 </xsl:attribute>
148 </xsl:if>
149 <xsl:copy-of select="$content"/>
150 </tt>
151 </strong>
152 </xsl:otherwise>
153 </xsl:choose>
154 </xsl:template>
155
156 <xsl:template name="inline.italicmonoseq">
157 <xsl:param name="content">
158 <xsl:call-template name="anchor"/>
159 <xsl:call-template name="simple.xlink">
160 <xsl:with-param name="content">
161 <xsl:apply-templates/>
162 </xsl:with-param>
163 </xsl:call-template>
164 </xsl:param>
165 <em class="{local-name(.)}">
166 <tt>
167 <xsl:if test="@dir">
168 <xsl:attribute name="dir">
169 <xsl:value-of select="@dir"/>
170 </xsl:attribute>
171 </xsl:if>
172 <xsl:copy-of select="$content"/>
173 </tt>
174 </em>
175 </xsl:template>
176
177
178</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.