OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: changing how xrefs to listings are rendered in PDF

Hi All,

I'm writing a book using Docbook and have an issue with how references
to listings are rendered in PDF version.

For example, my docbook file contains the following fragment:

<simpara>Blah blah blah as presented on listing <xref

<formalpara id="listing_shortest_test">
<title>One-Liner Test</title>
<programlisting language="java" linenumbering="unnumbered">
// some cool code here

In PDF version (generated with fop) xhref link to the listing is rendered as:

"Blah blah blah as presented on listing One-Liner Test."

I would like to look it differently, i.e. like this:

"Blah blah blah as presented on listing 3.1"

I have achieved similar thing with tables and figures (as discussed
here http://is.gd/wAInBB) by tweaking the docbook-xsl/fo.xsl like
<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-number-and-title">
       <l:template name="table" text="Table %n"/>

I have tried to do the same with listings, using various options
(well, I was just shooting in the dark, I know...):

      <l:context name="xref-number-and-title">
        <l:template name="listing" text="Listing %n"/>
        <l:template name="example" text="Listing %n"/>
        <l:template name="formalpara" text="Listing %n"/>

but without any success. I have also tried to change value of
xref.with.number.and.title but
this seems to be broken (nothing happens).

I read http://www.sagehill.net/docbookxsl/CustomGentext.html and a lot
of other docbook xsl information, but I still do not know how to do

Could you please help?

P.S. To give you the full picture, I'm using AsciiDoc, but I do not
think it matters. At some point I got a valid docbook document which
is converted to PDF and this is the part I'm struggling with.

Tomek Kaczanowski

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]