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

summation of attributes

Subject: summation of attributes
From: michael.bierenfeld@xxxxxxxx
Date: Tue, 27 May 2003 10:04:29 +0200
fo table attributes
Hi there, 
 
I am having a fop document that has to be transferred to html. Right now I am struugling with the following situation. 
 
fop.xml : 
 
*snip* 
<fo:table width="100%"> 
 
	<fo:table-column column-width="proportional-column-width(68)"/> 
	<fo:table-column column-width="proportional-column-width(95)"/> 
 
	.... continued .... 
 
</fo:table> 
*snip> 
 
this has to be transferred to 
 
<table> 
	<colgroup> 
		<col width="41%"/>     <!-- 68 * 100 / (68 + 95) --> 
		<col width="59%"/>     <!-- 95 * 100 / (68 + 95) --> 
	</colgroup> 
 
    .. continued ... 
</table> 
 
right know I am using the following templates 
 
<xsl:template match="fo:table"> 
	<table> 
		<xsl:variable name="summated_attributes" select="sum(fo:table-column/ @column-width)"/> 
		<colgroup> 
			<xsl:apply-templates match="fo:table-column"> 
				<xsl:with-param name="total_sum" value="$summated_attributes"/> 
			</xsl:apply-templates> 
		</colgroup> 
	</table> 
</xsl:template> 
 
<xsl:template match="fo:table-column"> 
	<xsl:param-name="total_sum"/> 
	<col> 
		<xsl:attribute name="width" select="@column-width * 100 div $total_sum">%</xsl:attribute> 
	</col> 
</xsl:template> 
 
unfortunatly column-width is encoded as "proportinal-column-with(68)" where 68 is the value I need therefore I am also doing 
 
<xsl:template match="@column-width"> 
	<xsl:value-of select="substring(., 27,2)"/> 
</xsl:template> 
 
_but this is not working_ 
 
does anybody have an idea ? 
 
Michael 
 
 
 
 


 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.