File: use.role.as.xrefstyle.html

package info (click to toggle)
docbook-xsl-doc 1.75.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 6,848 kB
  • ctags: 3,038
  • sloc: makefile: 34; sh: 5
file content (86 lines) | stat: -rw-r--r-- 5,081 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>use.role.as.xrefstyle</title><link rel="stylesheet" href="reference.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="../index.html" title="DocBook XSL Stylesheets: ReferenceDocumentation"><link rel="up" href="xrefs.html" title="Cross References"><link rel="prev" href="insert.xref.page.number.html" title="insert.xref.page.number"><link rel="next" href="xref.with.number.and.title.html" title="xref.with.number.and.title"><link rel="copyright" href="copyright.html" title="License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">use.role.as.xrefstyle</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="insert.xref.page.number.html">Prev</a></td><th width="60%" align="center">Cross References</th><td width="20%" align="right"><a accesskey="n" href="xref.with.number.and.title.html">Next</a></td></tr></table><hr></div><div class="refentry" title="use.role.as.xrefstyle"><a name="use.role.as.xrefstyle"></a><div class="titlepage"></div>

<div class="refnamediv"><h2><span class="refentrytitle">use.role.as.xrefstyle</span></h2><p>
use.role.as.xrefstyle
 &#8212; Use <code class="sgmltag-attribute">role</code> attribute for
<code class="sgmltag-attribute">xrefstyle</code> on <a href="http://docbook.org/tdg5/en/html/xref.html"><code class="sgmltag-element">xref</code></a>?
</p></div>

<div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2>
<a name="use.role.as.xrefstyle.frag"></a><pre class="programlisting">
&lt;xsl:param name="use.role.as.xrefstyle" select="1"&gt;&lt;/xsl:param&gt;
</pre>
</div>

<div class="refsection" title="Description"><a name="id1390894"></a><h2>Description</h2>

<p>In DocBook documents that conform to a schema older than V4.3, this parameter allows 
<code class="sgmltag-attribute">role</code> to serve the purpose of specifying the cross reference style.</p>

<p>If non-zero, the <code class="sgmltag-attribute">role</code> attribute on
<a href="http://docbook.org/tdg5/en/html/xref.html"><code class="sgmltag-element">xref</code></a> will be used to select the cross reference style.
In DocBook V4.3, the <code class="sgmltag-attribute">xrefstyle</code> attribute was added for this purpose.
If the <code class="sgmltag-attribute">xrefstyle</code> attribute is present, 
<code class="sgmltag-attribute">role</code> will be ignored, regardless of the setting
of this parameter.</p>

</div>

<div class="refsection" title="Example"><a name="id1390949"></a><h2>Example</h2>

<p>The following small stylesheet shows how to configure the
stylesheets to make use of the cross reference style:</p>

<pre class="programlisting">&lt;?xml version="1.0"?&gt;
&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0"&gt;

&lt;xsl:import href="../xsl/html/docbook.xsl"/&gt;

&lt;xsl:output method="html"/&gt;

&lt;xsl:param name="local.l10n.xml" select="document('')"/&gt;
&lt;l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"&gt;
  &lt;l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en"&gt;
   &lt;l:context name="xref"&gt;
      &lt;l:template name="chapter" style="title" text="Chapter %n, %t"/&gt;
      &lt;l:template name="chapter" text="Chapter %n"/&gt;
    &lt;/l:context&gt;
  &lt;/l:l10n&gt;
&lt;/l:i18n&gt;

&lt;/xsl:stylesheet&gt;</pre>

<p>With this stylesheet, the cross references in the following document:</p>

<pre class="programlisting">&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
                  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"&gt;
&lt;book id="book"&gt;&lt;title&gt;Book&lt;/title&gt;

&lt;preface&gt;
&lt;title&gt;Preface&lt;/title&gt;

&lt;para&gt;Normal: &lt;xref linkend="ch1"/&gt;.&lt;/para&gt;
&lt;para&gt;Title: &lt;xref xrefstyle="title" linkend="ch1"/&gt;.&lt;/para&gt;

&lt;/preface&gt;

&lt;chapter id="ch1"&gt;
&lt;title&gt;First Chapter&lt;/title&gt;

&lt;para&gt;Irrelevant.&lt;/para&gt;

&lt;/chapter&gt;
&lt;/book&gt;</pre>

<p>will appear as:</p>

<div class="informalexample">
<p>Normal: Chapter 1.</p>
<p>Title: Chapter 1, <span class="emphasis"><em>First Chapter</em></span>.</p>
</div>
</div>

</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="insert.xref.page.number.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="xrefs.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="xref.with.number.and.title.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">insert.xref.page.number</td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top">xref.with.number.and.title</td></tr></table></div></body></html>