xsl-list
[Top] [All Lists]

Re: [xsl] XSL:FO dynamic font size based on width

2008-06-27 06:21:34
   <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. 
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--