← Prev in month ← Prev in thread
Next in thread → Next in month →

Re: [docbook-apps] How to suppress "the section called" in crossrefs?

From
Thomas Schraitle <>
Date
2006-12-07T07:06:09+00:00
ID
Thread
Re: [docbook-apps] How to suppress "the section called" in crossrefs?
Hi Paul,

> Suppose that I have input like this:
> 
> For more information, see <xref linkend="some-id"/>.
> 
> For HTML, the output looks like this:
> 
> For more information, see the section called "My Section Title Here".
> 
> 
> Is there a parameter that I can use to suppress the "the section called"
> part?

There are two options:

1. Use xrefstyle to customize your cross reference
This is useful, if you want to customize xrefs individually. However, you have to use
the attribute xrefstyle on *every* xref.

See http://www.sagehill.net/docbookxsl/CustomXrefs.html#Xrefstyle

For example: <xref linkend="some-id"  xrefstyle="select: title"/>
(See Table 14.1: Keywords for xrefstyle select: for more keywords)


2. Add a customization layer for localization
This needs a bit more effort as you have to use a XSLT customization layer that
contains your corrections.

See http://www.sagehill.net/docbookxsl/CustomXrefs.html#XrefGentext


> [...]
> In fact, if I can suppress the surrounding quotes, I'd like to do that,
> too.  I just want the text of the cross-referenced section's title,
> nothing else.  Possible?

Use method 2 in your XSLT customization layer and add:

<xsl:param name="local.l10n.xml" select="document('')"/> 
<l:i18n xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0"> 
  <l:l10n language="en"> 
     <l:context name="xref">
       <!-- ... -->
       <l:template name="sect1" text="%t"/>
     </l:context>
  </l:l10n>
</l:i18n>

The original file is located at /path/to/docbook-xsl-stylesheets/common/en.xml. 

Hope that helps. :)

Tom
← Prev in month ← Prev in thread
Next in thread → Next in month →