← Prev in month ← Prev in thread

customize <exmaple> to use the attribute of label as caption

From
Sherwood Hu <>
Date
2009-08-20T21:41:53+00:00
ID
Thread
customize <exmaple> to use the attribute of label as caption
Hi,

 

We publish technical articles which often contain blocks of
source code. We are currently using <programlisting> for the source code.

<programlisting>

…

</programlisting>

 

Now we want to add a title (with auto numbering) like
Listing 1. Imagedisplay.php. I looked at docbook documentation, and the closest
tag I can find is <example>

 

<example><title>…</title><programlisting>..</programlisting>

 

The problem is that it displays Example. We can go into the
XSL to change all of them to Listing, but doing this will conflict with
existing <example> block. 

 

I noticed that <example> has an attribute of label. So
is it possible to change the caption of example to the value of label
attribute? 

 

I just started to learn XSLT. Thanks.
← Prev in month ← Prev in thread