[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Finding a fo:table-cells parent column's width for
Subject: Re: Finding a fo:table-cells parent column's width for nestedtable
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Fri, 07 Mar 2003 01:19:39 +0100
|
JD Daniels wrote:
I am a little confused.. What do you mean by default templates?
There is a built-in template for every element and for text nodes,
which wont pass parameters. See the FAQ or the XSLT spec for more
details.
Say the xsl stylesheet has processed the parent table, and we have
column-width=70mm
column-width=110mm
column-width=70mm
now two rows down and one column into this table, I have an another table.
Is there a way to tell that iteration that it only has 110mm to assign to
the newest table width? (ie- pass 110 as blockwidth to process-col-width)
Umm, I forgot you'll have to pass the column width rather than the
block width. This is a bit of a challenge, it seems the conceptionally
easiest way would be to build a variable with an RTF containing the
column widths
<xsl:variable name="columns">
<xsl:variable name="top-row-cells"
select="counttr[1]/th|tr[1]/td"/>
<xsl:variable name="column-count" select="count($top-row-cells)"/>
<xsl:for-each select="$top-row-cells">
<fo:table-column>
<xsl:attribute name="column-width">
<xsl:call-template name="process-col-width">
<xsl:with-param name="width" select="@width"/>
<xsl:with-param name="numcols" select="$column-count)/>
<xsl:with-param name="parentblockwidth"
select="$blockwidth"/>
</xsl:call-template>
</xsl:attribute>
</fo:table-column>
</xsl:for-each>
</xsl:variable>
Copy this into the table and alos pass this as a node set to the row
templates. You need a processor specific extension function for this,
look it up in your processor's docs:
<fo:table-body>
<xsl:apply-templates>
<xsl:with-param name="columns" select="exslt:node-set($columns)"/>
</xsl:apply-templates>
</fo:table-body>
In the td templates, retrieve the width:
<xsl:template match="td">
<xsl:param name="columns"/>
<xsl:variable name="position" select="position()"/>
<xsl:variable name="blockwidth"
select="columns[$position]/@column-width"/>
...
Don't forget to pass the necessary parameters through intermediate
templates.
J.Pietschmann
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
RSS 2.0 |
|
Atom 0.3 |
|
|