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

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook message

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


Subject: Re: Re[2]: DOCBOOK: Figure Numbers (DocBook XSL)


> From: Dave Makower <davemak@iclick.com>
> 
> I tried your test case, and you're right: it also works fine for me 
> with XT.  However, I altered it slightly and was able to reproduce my 
> symptom.  Here's the XML and the resulting HTML.

Your change was to put each figure inside a <section>
element.  The problem here is that Norm's XSL template for
figure xrefs generates a figure number using

<xsl:number format="1."/>

Since the level, count, and from attributes
are not specified in the template, the default behavior is
used.  The default behavior is to count preceding-siblings
of the same element.

In Norm's example, the <figure>s were all siblings
in the <article> element, so they are counted
correctly.  In your modified example, each
<figure> is inside its own <section> element, so the
figure elements are no longer siblings.  That's
why your figures are all numbered with "1".

There are any number of figure numbering policies,
including using chapter and section number prefixes.
I suspect Norm has intentions of making that
a configurable parameter.  The policy gets more
complicated when <section> is used, because it
can appear in so many places.

You can get your example to do what you want by changing
one line the XSL stylesheet.  In common/common.xsl,
in the template starting with:

<xsl:template match="figure|table|example|equation" mode="label.content">

change this line:

  <xsl:number format="1."/>

to:

  <xsl:number level="any" from="chapter|article" format="1."/>

or to whatever policy you want to implement.

bobs
Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The Santa Cruz Operation, Inc.              fax:   (831) 429-1887
                                            email: bobs@sco.com



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


Powered by eList eXpress LLC