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

Finding a fo:table-cells parent column's width for nes

Subject: Finding a fo:table-cells parent column's width for nested table
From: "JD Daniels" <jd@xxxxxxxxxxxx>
Date: Thu, 6 Mar 2003 14:15:59 -0800
fo table cell border style
I have this template to make a fo:table element from a html table. It works
fine, but it uses a pagewidth variable, which I have set at the top of the
style sheet. (It is the printable area of my fo page)
So What is happening, is if a table occurrs inside a table cell, my
figure-out-the-width temlpate only has the global variable.. which is the
width of the whole page.. not the containing cell

I have changed it so that the template that figures out the width uses a
param i pass it, but how can I figure out if the table is inside a table
cell, and pass it the value of the parent table cells parent fo:table-column
width?

I got this template culled from a few different snippets I have found on the
mailing lists and renderx's site... I do not really understand
preceding-sibling::* | following-sibling::*      stuff  :P


<xsl:template match="table|tbody">
<fo:table>
 <xsl:for-each select="tr[1]/th|tr[1]/td">
  <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">
     <xsl:value-of select="number(count(preceding-sibling::* |
following-sibling::*) + 1)"/>
    </xsl:with-param>
    <xsl:with-param name="parentblockwidth">
     <xsl:value-of select="$bodywidth"/>
    </xsl:with-param>
   </xsl:call-template>
  </xsl:attribute>
  </fo:table-column>
 </xsl:for-each>
<fo:table-body>
 <xsl:apply-templates />
</fo:table-body>
</fo:table>
</xsl:template>

Example output would be:

- <fo:table>
  <fo:table-column column-width="70mm" />
  <fo:table-column column-width="70mm" />
  <fo:table-column column-width="70mm" />
- <fo:table-body>
- <fo:table-row>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block>test</fo:block>
  </fo:table-cell>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block />
  </fo:table-cell>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block />
  </fo:table-cell>
  </fo:table-row>
- <fo:table-row>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block />
  </fo:table-cell>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block>test</fo:block>
  </fo:table-cell>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block />
  </fo:table-cell>
  </fo:table-row>
- <fo:table-row>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block />
  </fo:table-cell>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block />
  </fo:table-cell>
- <fo:table-cell border-style="solid" border-width="1pt">
  <fo:block>test</fo:block>
  </fo:table-cell>
  </fo:table-row>
  </fo:table-body>
  </fo:table>
  </fo:block>
  </fo:table-cell>
  </fo:table-row>
  </fo:table-body>
  </fo:table>



JD


 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.