[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: [xsl-fo] generating the correct number of columns

Subject: RE: [xsl-fo] generating the correct number of columns for a table from html to xsl-fo
From: "El Hage Camille" <CAMILLE.ELHAGE@xxxxxxxxxxxxxxxx>
Date: Mon, 14 Oct 2002 20:02:38 +0200
xsl table columns
David Carlisle wrote:
>    <xsl:for-each select="//*[position() &lt;= 8]">
>    <fo:table-column column-width="2cm"/> 
>    </xsl:for-each>

thanks for answering David, however I still have two problems:

1- the value 8 is in a variable called maxNumbers and the following does not seem to work:
<xsl:for-each select="//*[position() &lt;=$maxNumbers]">

2- the number of fo:table-column genereated by the following code is more than 8, it is 94.

<xsl:template match="performance-table">

  <xsl:variable name="maxNumbers">
    <xsl:for-each select="performance-tables/performance-table/performance-table-tr">
      <xsl:if test="count(performance-tables/performance-table/performance-table-tr[count(performance-table-td) >
count(current()/performance-table-td)]) = 0">
        <xsl:value-of select="count(performance-table-td)"/>:
      </xsl:if>
    </xsl:for-each>
  </xsl:variable>
  <xsl:value-of select="substring-before($maxNumbers,':')"/>

	<fo:table>
		<xsl:for-each select="//*[position() &lt;= 8]"> 
			<fo:table-column column-width="2cm"/>
		</xsl:for-each>
	  <fo:table-body>
	  	<xsl:apply-templates select="performance-table-tr"/>
  	  </fo:table-body>
  	</fo:table>

</xsl:template>

here is the source xml:

	<performance-tables>
		<performance-table-name>123546</performance-table-name>
		<performance-table-remark>bla bla bla</performance-table-remark>
		<performance-table>
			<performance-table-tr/>
			<performance-table-tr>
				<performance-table-td>rty</performance-table-td>
				<performance-table-td>rty</performance-table-td>
				<performance-table-td>rty.</performance-table-td>
				<performance-table-td> </performance-table-td>
				<performance-table-td>rty</performance-table-td>
				<performance-table-td>rty</performance-table-td>
			</performance-table-tr>
			<performance-table-tr>
				<performance-table-td> </performance-table-td>
				<performance-table-td> </performance-table-td>
				<performance-table-td>yu</performance-table-td>
				<performance-table-td>ui</performance-table-td>
				<performance-table-td>uio</performance-table-td>
				<performance-table-td>io</performance-table-td>
				<performance-table-td>ki</performance-table-td>
				<performance-table-td>mpl</performance-table-td>
			</performance-table-tr>
			<performance-table-tr>
				<performance-table-td> </performance-table-td>
				<performance-table-td> </performance-table-td>
				<performance-table-td>1</performance-table-td>
				<performance-table-td>2</performance-table-td>
				<performance-table-td>3</performance-table-td>
				<performance-table-td>4</performance-table-td>
				<performance-table-td>5</performance-table-td>
				<performance-table-td> </performance-table-td>
			</performance-table-tr>
			<performance-table-tr>
				<performance-table-td>6| - 12 - 6</performance-table-td>
				<performance-table-td>Clear</performance-table-td>
				<performance-table-td>23</performance-table-td>
				<performance-table-td>6</performance-table-td>
				<performance-table-td>2</performance-table-td>
				<performance-table-td>83</performance-table-td>
				<performance-table-td>17</performance-table-td>
				<performance-table-td>17</performance-table-td>
			</performance-table-tr>
			<performance-table-tr>
				<performance-table-td>6| - 12Ar - |6</performance-table-td>
				<performance-table-td>Dark blue</performance-table-td>
				<performance-table-td>23</performance-table-td>
				<performance-table-td>6</performance-table-td>
				<performance-table-td>2</performance-table-td>
				<performance-table-td>83</performance-table-td>
				<performance-table-td>16</performance-table-td>
				<performance-table-td>16</performance-table-td>
			</performance-table-tr>
			<performance-table-tr>
				<performance-table-td>6| - 12 - 6</performance-table-td>
				<performance-table-td>Brilliant bronze</performance-table-td>
				<performance-table-td>25</performance-table-td>
				<performance-table-td>18</performance-table-td>
				<performance-table-td>3</performance-table-td>
				<performance-table-td>63</performance-table-td>
				<performance-table-td>20</performance-table-td>
				<performance-table-td>20</performance-table-td>
			</performance-table-tr>
		</performance-table>
	</performance-tables>

any idea on how to solve this?
regards,
Camille

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.