[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
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|