File: //usr/share/doc/docbook-style-xsl-1.69.1/doc/html/use.role.as.xrefstyle.html
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>use.role.as.xrefstyle</title><link rel="stylesheet" href="../ref.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.0"><link rel="start" href="index.html" title="HTML Parameter Reference"><link rel="up" href="rn16.html" title="Miscellaneous"><link rel="prev" href="use.svg.html" title="use.svg"><link rel="next" href="menuchoice.separator.html" title="menuchoice.separator"></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="use.svg.html">Prev</a> </td><th width="60%" align="center">Miscellaneous</th><td width="20%" align="right"> <a accesskey="n" href="menuchoice.separator.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="use.role.as.xrefstyle"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>use.role.as.xrefstyle — Use <code class="sgmltag-attribute">role</code> attribute for
<code class="sgmltag-attribute">xrefstyle</code> on <a href="http://docbook.org/tdg/en/html/xref.html"><code class="sgmltag-element">xref</code></a>?</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><a name="use.role.as.xrefstyle.frag"></a><pre class="programlisting">
<xsl:param name="use.role.as.xrefstyle" select="1"></xsl:param>
</pre></div><div class="refsect1" lang="en"><a name="d0e4525"></a><h2>Description</h2><p>If non-zero, the <code class="sgmltag-attribute">role</code> attribute on
<a href="http://docbook.org/tdg/en/html/xref.html"><code class="sgmltag-element">xref</code></a> will be used to select the cross reference style.
The <a href="http://www.oasis-open.org/docbook/" target="_top">DocBook
Technical Committee</a> recently added an
<code class="sgmltag-attribute">xrefstyle</code> attribute 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 this setting.</p><p>Until an official DocBook release that includes the new
attribute, this flag allows <code class="sgmltag-attribute">role</code>
to serve that purpose.</p></div><div class="refsect1" lang="en"><a name="d0e4553"></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"><?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:import href="../xsl/html/docbook.xsl"/>
<xsl:output method="html"/>
<xsl:param name="local.l10n.xml" select="document('')"/>
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">
<l:l10n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0" language="en">
<l:context name="xref">
<l:template name="chapter" style="title" text="Chapter %n, %t"/>
<l:template name="chapter" text="Chapter %n"/>
</l:context>
</l:l10n>
</l:i18n>
</xsl:stylesheet></pre><p>With this stylesheet, the cross references in the following document:</p><pre class="programlisting"><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book id="book"><title>Book</title>
<preface>
<title>Preface</title>
<para>Normal: <xref linkend="ch1"/>.</para>
<para>Title: <xref xrefstyle="title" linkend="ch1"/>.</para>
</preface>
<chapter id="ch1">
<title>First Chapter</title>
<para>Irrelevant.</para>
</chapter>
</book></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="use.svg.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="rn16.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="menuchoice.separator.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">use.svg </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> menuchoice.separator</td></tr></table></div></body></html>