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: DOCBOOK: numbered Q&A entries how?


On Sat, Jul 20, 2002 at 12:10:29AM +1200, David Kilgour wrote:
> I would like my Q&A entries to be numbered:
> 
> Q1
> 
> A
> 
> Q2
> 
> A
> 
> and for this numbering to continue across chapters. I would like to do
> this with both dsssl and xml docbook. Any suggestions welcome.

I can't say how to do this with DSSSL, and I assume 
when you say "xml docbook" you mean the XSL stylesheets?

For XSL, if you are willing to forego all the options 
for controlling the QandA labels and just want to hardwire
your style, then add these templates
to your XSL customization layer:

<xsl:template match="question" mode="label.markup">
    <xsl:text>Q</xsl:text>
    <xsl:number level="any" count="qandaentry" format="1"/>
</xsl:template>

<xsl:template match="answer" mode="label.markup">
    <xsl:text>A</xsl:text>
</xsl:template>

The <xsl:number> with level="any" counts all instances of qandaentry
elements in your document, and doesn't reset.

But if you localize your doc (so 'Q' and 'A' might not
be appropriate), or want the option to change labeling
for a given qandaset, then you should copy the whole
template from common/labels.xsl:

<xsl:template match="question|answer" mode="label.markup">

to your customization layer and make similar changes.

-- 

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


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


Powered by eList eXpress LLC