forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johannes Schaefer (JIRA)" <>
Subject [jira] Commented: (FOR-769) tables don't support row/colspan
Date Tue, 20 Dec 2005 13:12:30 GMT
    [ ] 

Johannes Schaefer commented on FOR-769:

I implemented this, but have a question before comitting.

I would like to avoid code duplication as is the case in the match for <entry> in sdocbook2document.xsl
from the plugin, see the code snippet below. The same template exists for <entry> with
mode="thead" the only difference beeing <th> instead of <td>. I look for an option
to avoid duplication and see the following:
1. use a named template and call this
2. match <entry> without node and check name(..) to insert <td> or <th>
3. pass "td" or "th" as a parameter to the template
What would be the best way?

      <xsl:template match="entry">
              <!-- this code is duplicated in template match="entry" mode="thead" -->
              <xsl:if test="@morerows">
                <xsl:attribute name="rowspan">
                  <xsl:value-of select="number(@morerows)+1"/>
              <xsl:if test="@namest and @nameend">
                <xsl:attribute name="colspan">

                <xsl:variable name="start">
                  <xsl:call-template name="colspec.index">
                    <xsl:with-param name="olist" select="ancestor::tgroup/colspec"/>
                    <xsl:with-param name="colname" select="@namest"/>
                <xsl:variable name="end">
                  <xsl:call-template name="colspec.index">
                    <xsl:with-param name="olist" select="ancestor::tgroup/colspec"/>
                    <xsl:with-param name="colname" select="@nameend"/>

                  <xsl:value-of select="number($end)-number($start)+1"/>
              <!-- end code duplication -->

> tables don't support row/colspan
> --------------------------------
>          Key: FOR-769
>          URL:
>      Project: Forrest
>         Type: Bug
>   Components: Plugin: Simplified Docbook
>     Versions: 0.7
>  Environment: all
>     Reporter: Johannes Schaefer
>     Assignee: Johannes Schaefer
>  Attachments: index.xml
> the plugin should support the sDocBook attributes to span rows and columns in a table;
see attached file and below
> <table>
> ...
>   <colspec  colname='c1'/>
>   <colspec  colname='c2'/>
>   <colspec  colname='c3'/>
>   <colspec colnum='5' colname='c5'/>
> ...
>   <entry morerows='1>
>   <entry namest="c2" nameend="c5">span to c5</entry>
>   <entry namest="c2" nameend="c3" morerows='1'>
> </table>

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message