Well, in fact, that's to product a  *.fo file  to use fope to generate a *.pdf
file.

what I do is (sorry for the longness):

    <xsl:template match="ARTICLE/PARA/TABLE">
     <fo:table space-before.optimum="10pt" width="6.26in">
  <!--calculous of the cell width>-->
   <xsl:for-each select="ROW[1]/CELL">
      <fo:table-column column-width="?????????" border-color="black"
border-style="solid" border-width="1pt"/>
   </xsl:for-each>
      <fo:table-body font-size="10pt" font-family="sans-serif">
   <xsl:apply-templates/>
      </fo:table-body>
     </fo:table>
    </xsl:template>

    <xsl:template match="ARTICLE/PARA/TABLE/ROW">
    <fo:table-row line-height="12pt">
 <xsl:apply-templates/>
    </fo:table-row>
    </xsl:template>

    <xsl:template match="ARTICLE/PARA/TABLE/ROW/CELL[not(@type='header')]">
    <fo:table-cell border-width="1pt" border-color="black" border-style="solid"
padding="6pt">
 <fo:block font-size="8pt" text-align="justify">
   <xsl:apply-templates/>
 </fo:block>
    </fo:table-cell>
    </xsl:template>

so, I want to know the number of cells (that's to say the number of columns)
in a line to be able to calculate their width....
(in the template ARTICLE/PARA/TABLE)
Problem is that to translate to pdf usinf fop, I need knowind this width before
making the rows.... :^|

Regards (and thanks for your response)
Pierre



> I think xsl:number is not what you need. You can count cells using the
> last() function:
>
> <xsl:template match="row">
>   <fo:column column-width="{last()}"/>
>   column definition
> </xsl:template>
>
> Storing a value and using it in another template is a problem, you should
> try to count rows and generate table rows in once. Is it possible to specify
> the column with for each column or it must be determined before the table
> itself?
>
> Petr
>
> Pierre Rougier wrote:
>
> > Hi all, (and thanks Pter for giving me the email of the python extension
> > developer)
> >
> > I just have a very simple problem (but aren't all problems
> > simples.....?) anyway:
> >
> > I want to count the number of cells in a table row:
> >     I explain:
> >                 in
> >                     <table>
> >                             <row>
> >                                     <cell> any content </cell>
> >                                     <cell> any content </cell>
> >                                     <cell> any content </cell>
> >                             </row>
> >                             <row>
> >                                     <cell> any content </cell>
> >                                     <cell> any content </cell>
> >                                     <cell> any content </cell>
> >                             </row>
> >                     </table>
>

Reply via email to