Variable number of table columns

"Eklund Anders" <[email protected]>
Newsgroups gmane.text.xml.xsl.general
Message-ID <[email protected]>



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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.