source: BLFS/libs/book.xsl@ 4fe29a2

experimental
Last change on this file since 4fe29a2 was 4fe29a2, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Solved wrong and dead cross-references.

  • Property mode set to 100644
File size: 3.4 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<!-- $Id$ -->
8
9 <!-- NOTE: the base dir (blfs-xml) must be changed to FAKEDIR on the
10 final version and set it to the proper dir via a sed in ./blfs -->
11 <xsl:import href="../blfs-xml/stylesheets/blfs-chunked.xsl"/>
12
13 <xsl:param name="mail_server" select="sendmail"/>
14
15 <xsl:param name="xwindow" select="xorg7"/>
16
17 <!-- Template from BLFS_XML/stylesheets/xhtml/lfs-xref.xsl.-->
18 <xsl:template match="xref" name="xref">
19
20 <!-- IDs that need be remaped to the proper file -->
21 <xsl:variable name="linkend">
22 <xsl:choose>
23 <xsl:when test="@linkend = 'alsa'">
24 <xsl:text>alsa-lib</xsl:text>
25 </xsl:when>
26 <xsl:when test="@linkend = 'arts'">
27 <xsl:text>aRts</xsl:text>
28 </xsl:when>
29 <xsl:when test="@linkend = 'kde'">
30 <xsl:text>kdelibs</xsl:text>
31 </xsl:when>
32 <xsl:when test="@linkend = 'server-mail'">
33 <xsl:value-of select="$mail_server"/>
34 </xsl:when>
35 <xsl:when test="@linkend = 'x-window-system'">
36 <xsl:value-of select="$xwindow"/>
37 </xsl:when>
38 <xsl:otherwise>
39 <xsl:value-of select="@linkend"/>
40 </xsl:otherwise>
41 </xsl:choose>
42 </xsl:variable>
43
44 <xsl:variable name="targets" select="key('id',$linkend)"/>
45 <!-- -->
46
47 <xsl:variable name="target" select="$targets[1]"/>
48 <xsl:variable name="refelem" select="local-name($target)"/>
49 <xsl:variable name="role" select="@role"/>
50 <xsl:call-template name="check.id.unique">
51 <xsl:with-param name="linkend" select="$linkend"/>
52 </xsl:call-template>
53 <xsl:call-template name="anchor"/>
54 <xsl:choose>
55
56 <!-- Dead links -->
57 <xsl:when test="count($target) = 0">
58 <xsl:value-of select="@linkend"/>
59 <xsl:text> (link in the full book)</xsl:text>
60 </xsl:when>
61 <!-- -->
62
63 <xsl:when test="$target/@xreflabel">
64 <a>
65 <xsl:attribute name="href">
66 <xsl:call-template name="href.target">
67 <xsl:with-param name="object" select="$target"/>
68 </xsl:call-template>
69 </xsl:attribute>
70 <xsl:call-template name="xref.xreflabel">
71 <xsl:with-param name="target" select="$target"/>
72 </xsl:call-template>
73 </a>
74 </xsl:when>
75 <xsl:otherwise>
76 <xsl:variable name="href">
77 <xsl:call-template name="href.target">
78 <xsl:with-param name="object" select="$target"/>
79 </xsl:call-template>
80 </xsl:variable>
81 <xsl:apply-templates select="$target" mode="xref-to-prefix"/>
82 <a href="{$href}">
83 <xsl:if test="$target/title or $target/*/title">
84 <xsl:attribute name="title">
85 <xsl:apply-templates select="$target" mode="xref-title"/>
86 </xsl:attribute>
87 </xsl:if>
88 <xsl:apply-templates select="$target" mode="xref-to">
89 <xsl:with-param name="referrer" select="."/>
90 <xsl:with-param name="role" select="$role"/>
91 <xsl:with-param name="xrefstyle">
92 <xsl:value-of select="@xrefstyle"/>
93 </xsl:with-param>
94 </xsl:apply-templates>
95 </a>
96 <xsl:apply-templates select="$target" mode="xref-to-suffix"/>
97 </xsl:otherwise>
98 </xsl:choose>
99 </xsl:template>
100
101</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.