[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Calculations involving measurements with units

Subject: [xsl] Calculations involving measurements with units
From: "Paul A. Hoadley" <paulh@xxxxxxxxxxxxxx>
Date: Fri, 2 Jan 2004 17:46:27 +1030


I am using a parameter called 'page-height', set to, say, '297mm' for
an A4 page.  I have a particular margin I want to set to '$page-height
/ 3.75'---what is the best way to strip the trailing 'mm' prior to the
calculation and append it again to the result?  My first attempt was
to start with a variable:

<xsl:variable name="upper-margin" select="number($page-height) / 3.75"/>

and then open the fo:block with:

<fo:block text-align="center" margin-top="$upper-margin">

The XPath in the xsl:variable element above is apparently invalid.  I
also need to append the 'mm' prior to using the variable in the
fo:block.  What is the best approach here?



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

Current Thread