[xsl] summation of attributes

Subject: [xsl] summation of attributes
From: michael.bierenfeld@xxxxxxxx
Date: Tue, 27 May 2003 10:04:29 +0200
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 : 
<fo:table width="100%"> 
	<fo:table-column column-width="proportional-column-width(68)"/> 
	<fo:table-column column-width="proportional-column-width(95)"/> 
	.... continued .... 
this has to be transferred to 
		<col width="41%"/>     <!-- 68 * 100 / (68 + 95) --> 
		<col width="59%"/>     <!-- 95 * 100 / (68 + 95) --> 
    .. continued ... 
right know I am using the following templates 
<xsl:template match="fo:table"> 
		<xsl:variable name="summated_attributes" select="sum(fo:table-column/ @column-width)"/> 
			<xsl:apply-templates match="fo:table-column"> 
				<xsl:with-param name="total_sum" value="$summated_attributes"/> 
<xsl:template match="fo:table-column"> 
		<xsl:attribute name="width" select="@column-width * 100 div $total_sum">%</xsl:attribute> 
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)"/> 
_but this is not working_ 
does anybody have an idea ? 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread