This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

2 Questions: (1) about looping for declaring table columns (2) variable table widths


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]