[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: avt's

Subject: Re: avt's
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 Feb 2000 10:03:47 -0500
xsl size round
At 00/02/21 14:26 +0000, Pawson, David wrote:
I would like to specify a font size,
min optimum and max, with respect to
a global variable.

How about using attribute sets?


<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nl "&#xd;&#xa;">
]>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format"
                version="1.0">

<xsl:param name='hd-size' select="10"/>

<xsl:attribute-set name="font-metrics">
  <xsl:attribute name="font-size">
    <xsl:value-of select="$hd-size"/>pt</xsl:attribute>
  <xsl:attribute name="space-before.minimum">
    <xsl:value-of select="round(0.8 * $hd-size)"/>pt</xsl:attribute>
  <xsl:attribute name="space-before.maximum">
    <xsl:value-of select="round(1.2 * $hd-size)"/>pt</xsl:attribute>
  <xsl:attribute name="space-before.optimum">
    <xsl:value-of select="$hd-size"/>pt</xsl:attribute>
</xsl:attribute-set>

<xsl:template match="item">
  <fo:block xsl:use-attribute-sets="font-metrics">
    <xsl:apply-templates/>
  </fo:block>
</xsl:template>

</xsl:stylesheet>

Objective is to provide everything in relative sizes,
such that I can provide a variant (font size) for any users
preference.

I think the above will do that for you.


I hope this helps.

.............. Ken

--
G. Ken Holman                    mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.             http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999   (Fax:-0995)
Web site: XSL/XML/DSSSL/SGML services, training, libraries, products.
Practical Transformation Using XSLT and XPath      ISBN 1-894049-03-9
Next instructor-led training: 2000-02-27/28,2000-05-11/12,2000-05-15,
-                                    2000-06-12,2000-06-13,2001-01-27


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.