unitInPx
<xsl:template name="unitInPx" as="xs:double+"> <xsl:param name="valueUnit"/> <xsl:param name="fontSize"/> <xsl:param name="default" select="0"/> ... </xsl:template>
This template simply applies a computation with respect to the value unit. It can handles all these units: literal, px, em, ex, % and no unit.
A space literal is computed by using the getSpaceLiteral
template.
For example, by using this template, 3em will be computed 3 * fontSize
, 5 will be computed 5 * default
, etc.