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

2 Questions: (1) about looping for declaring table col

Subject: 2 Questions: (1) about looping for declaring table columns (2) variable table widths
From: "Gagan Bhalla" <gbhalla@xxxxxxxxxxxxxx>
Date: Mon, 27 Aug 2001 16:21:45 -0500
gagan bhalla
Q1>>
I am trying to create an fo:table using XSLT on an XML file which has table
elements passed in like so:

<table width="100.00%" border="1" cols="5" rows="4">

Based on the value of the attribute cols passed in, I want to declare
<fo:table-column> before constructing the rest of the <fo:table-body>. In
the code fragment below, how do I get the call to the template "tableColumn"
looped based on the value of  the attributes cols passed in rather than
hardcoding it?

<xsl:template match="table">
	<fo:table space-before.optimum="3pt" space-after.optimum="5pt">
	<!-- check the attributes for number of columns -->
	<xsl:variable name="ColsInTable"><xsl:value-of
select="@cols"/></xsl:variable>
	<xsl:value-of select="@cols"/>
	<xsl:apply-templates select="tableColumn" />
	<xsl:apply-templates select="tableColumn" />
	<xsl:apply-templates select="tableColumn" />
	<fo:table-body>
		<xsl:apply-templates/>
	</fo:table-body>
	</fo:table>
</xsl:template>
<!-- this defines a table column  -->
<xsl:template name="tableColumn">
	<fo:table-column column-width="50mm" border-width="0.5mm"
border-style="solid" />
</xsl:template>


Q2>>
Is there a way to get flexible column widths in <fo:table-column> based on
the text in the table cell rather than hardcoding in the <fo:table-column>
tag? I know fop 0.18.1 does not support that, but do the later versions like
fop 0.20.1 have this feature? Any workarounds?


Thanks,

Gagan


Gagan Bhalla
Senior Applications Architect
Mediaprise (www.mediaprise.com)
"....how brands leave their mark"
512-342-2530 Extn 246


 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.