Subject: Re: [xsl] XSL:FO dynamic font size based on width From: David Carlisle <davidc@xxxxxxxxx> Date: Fri, 27 Jun 2008 14:20:02 +0100 |
<xsl:variable name="title"> <xsl:value-of select="."/> </xsl:variable> It's almost always better (and always more efficient) to go <xsl:variable name="title" select="."/> or <xsl:variable name="title" select="string(.)"/> The first refers to the original element, the second makes a string, but <xsl:variable name="title"> <xsl:value-of select="."/> </xsl:variable> makes a document node (result tree fragment in xslt 1) with a child rtext node, which is a much more expensive thing. <xsl:value-of select="46 div (string-length($title) div 28)"/> that's just <xsl:value-of select="1288 div string-length($title)"/> pt </xsl:when> better to use <xsl:text>pt</xsl:text> otherwise you'll put a linebreak and 12 spaces into each attribute value, the linebreak will also be &-escaped. > The formula is reflective exponential well it's just a reciprocal not an exponential function. David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] XSL:FO dynamic font size , Wasiq Shaikh | Thread | RE: [xsl] XSL:FO dynamic font size , Angela Williams |
Re: [xsl] Split with delimiter and , David Carlisle | Date | Re: [xsl] LINQ to XML versus XSLT, bryan rasmussen |
Month |