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: Auto-numbering in tables


Title: Auto-numbering in tables

Hi people,
        I found the thread below using google, and it describes exactly what I need to do for generating PDF files using docbook-xsl-1.73.2.

        However, I can't get the numbers to appear in tables. I've put the xsl:template code in both fo/profile-docbook.xsl and fo/table.xsl but with no luck. (And yes I've replaced the [EMAIL PROTECTED] with table[atrole=). Any suggestions as to why?

        My table in the .xml looks like this:

<table role="autonumbered">
        <title>Blah</title>
        <tgroup cols='5' align='left' colsep='1' rowsep='1'>
        <thead>
                <row>
                        <entry>ID</entry>
                        <entry>Blah</entry>
                        <entry>Blah</entry>
                        <entry>Blah</entry>
                        <entry>Blah</entry>
                </row>
        </thead>
        <tbody>
                <row>
                        <entry></entry>
                        <entry>ditto</entry>
                        <entry>ditto</entry>
                        <entry>ditto</entry>
                        <entry>ditto</entry>
                </row>
                <row>
                        <entry></entry>
                        <entry>ditto</entry>
                        <entry>ditto</entry>
                        <entry>ditto</entry>
                        <entry>ditto</entry>
                </row>
        </tbody>
        </tgroup>
</table>

        Can someone maybe elaborate where Jirka says "Simply create stylesheet customization based on profiling stylesheet (like fo/profile-docbook.xsl or html/profile-chunk.xsl)"?

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="[EMAIL PROTECTED]'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>


Regards
James



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