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: Re: [docbook-apps] Table Row Counting


Dave Cushman wrote:

> Instead of manually entering the item number in the first column, I'd
> like to be able to have that generated during conversion so that it
> stays accurate as I add and remove items.  What is a good method to
> accomplish this?

It's kind of a hack but you can attach this autonumbering functionality
to profiling code in stylesheets. Simply create stylesheet customization
based on profiling stylesheet (like fo/profile-docbook.xsl or
html/profile-chunk.xsl) and then add special role to tables that should
have this functionality, like:

<table role="autonumbered">

and in your customized stylesheet use the following template:

<xsl:template
match="table[@role='autonumbered']/tgroup/tbody/row/entry[1]"
mode="profile">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:number count="row" level="single" from="tbody"/>
  </xsl:copy>
</xsl:template>


				Jirka

-- 
------------------------------------------------------------------
  Jirka Kosek      e-mail: jirka@kosek.cz      http://xmlguru.cz
------------------------------------------------------------------
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member
------------------------------------------------------------------

OpenPGP digital signature



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