source: stylesheets/lfs-xsl/docbook-xsl-1.78.1/params/use.role.as.xrefstyle.xml@ 67f507c

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 67f507c was 15c7d39, checked in by Matthew Burgess <matthew@…>, 11 years ago

Update stylesheets to docbook-xsl-1.78.1.

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

  • Property mode set to 100644
File size: 3.2 KB
Line 
1<refentry xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
5 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="5.0" xml:id="use.role.as.xrefstyle">
7<refmeta>
8<refentrytitle>use.role.as.xrefstyle</refentrytitle>
9<refmiscinfo class="other" otherclass="datatype">boolean</refmiscinfo>
10</refmeta>
11<refnamediv>
12<refname>use.role.as.xrefstyle</refname>
13<refpurpose>Use <tag class="attribute">role</tag> attribute for
14<tag class="attribute">xrefstyle</tag> on <tag>xref</tag>?</refpurpose>
15</refnamediv>
16
17<refsynopsisdiv>
18<src:fragment xml:id="use.role.as.xrefstyle.frag">
19<xsl:param name="use.role.as.xrefstyle" select="1"/>
20</src:fragment>
21</refsynopsisdiv>
22
23<refsection><info><title>Description</title></info>
24
25<para>In DocBook documents that conform to a schema older than V4.3, this parameter allows
26<tag class="attribute">role</tag> to serve the purpose of specifying the cross reference style.</para>
27
28<para>If non-zero, the <tag class="attribute">role</tag> attribute on
29<tag>xref</tag> will be used to select the cross reference style.
30In DocBook V4.3, the <tag class="attribute">xrefstyle</tag> attribute was added for this purpose.
31If the <tag class="attribute">xrefstyle</tag> attribute is present,
32<tag class="attribute">role</tag> will be ignored, regardless of the setting
33of this parameter.</para>
34
35</refsection>
36
37<refsection><info><title>Example</title></info>
38
39<para>The following small stylesheet shows how to configure the
40stylesheets to make use of the cross reference style:</para>
41
42<programlisting>&lt;?xml version="1.0"?&gt;
43&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
44 version="1.0"&gt;
45
46&lt;xsl:import href="../xsl/html/docbook.xsl"/&gt;
47
48&lt;xsl:output method="html"/&gt;
49
50&lt;xsl:param name="local.l10n.xml" select="document('')"/&gt;
51&lt;l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"&gt;
52 &lt;l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en"&gt;
53 &lt;l:context name="xref"&gt;
54 &lt;l:template name="chapter" style="title" text="Chapter %n, %t"/&gt;
55 &lt;l:template name="chapter" text="Chapter %n"/&gt;
56 &lt;/l:context&gt;
57 &lt;/l:l10n&gt;
58&lt;/l:i18n&gt;
59
60&lt;/xsl:stylesheet&gt;</programlisting>
61
62<para>With this stylesheet, the cross references in the following document:</para>
63
64<programlisting>&lt;?xml version="1.0" encoding="utf-8"?&gt;
65&lt;!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
66 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"&gt;
67&lt;book id="book"&gt;&lt;title&gt;Book&lt;/title&gt;
68
69&lt;preface&gt;
70&lt;title&gt;Preface&lt;/title&gt;
71
72&lt;para&gt;Normal: &lt;xref linkend="ch1"/&gt;.&lt;/para&gt;
73&lt;para&gt;Title: &lt;xref xrefstyle="title" linkend="ch1"/&gt;.&lt;/para&gt;
74
75&lt;/preface&gt;
76
77&lt;chapter id="ch1"&gt;
78&lt;title&gt;First Chapter&lt;/title&gt;
79
80&lt;para&gt;Irrelevant.&lt;/para&gt;
81
82&lt;/chapter&gt;
83&lt;/book&gt;</programlisting>
84
85<para>will appear as:</para>
86
87<informalexample>
88<para>Normal: Chapter 1.</para>
89<para>Title: Chapter 1, <emphasis>First Chapter</emphasis>.</para>
90</informalexample>
91</refsection>
92
93</refentry>
Note: See TracBrowser for help on using the repository browser.