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