Variable number of table columns

Variable number of table columns?

I have an .xml-file with tables. The problem is that I don't know the number of columns in each table.
Then I don't know how many <fo:table-column> I need to have a proportional table where all tables have the same width.
Anyone who can help?

========== Example .xml ===========
<table id="1">
  <row>
    <column>11</column>
    <column>12</column>
    <column>13</column>
  </row>
  <row>
    <column>21</column>
    <column>22</column>
    <column>23</column>
  </row>
</table>
<table id="2">
  <row>
    <column>11</column>
    <column>12</column>
  </row>
  <row>
    <column>21</column>
    <column>22</column>
  </row>
</table>

========== Example .xsl ===========
<xsl:for-each select="table">
  <fo:table>
     
     <!-- I don't know the number of columns in the .xml-file.
           How to design a "dynamic table"?  -->     
     
     <fo:table-column column-width="50pt"/>
     <fo:table-column column-width="50pt"/>


       <fo:table-body>
         <xsl:for-each select="row">
           <fo:table-row>
             <xsl:for-each select="column">
               <fo:table-cell>
                 <fo:block"><xsl:value-of select="."/></fo:block>
               </fo:table-cell>
             </xsl:for-each>
           </fo:table-row>                 
         </xsl:for-each>
      </fo:table-body>
   </fo:table>
</xsl:for-each>

Best Regards
Anders Eklund

Received on Thursday, 14 November 2002 07:50:47 UTC