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

Re: Template/function libraries for measurement units.

Subject: Re: Template/function libraries for measurement units.
From: Mulberry Technologies List Owner<xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 Jan 2003 10:48:03 -0500
list of measurement units
>Date: Mon, 20 Jan 2003 21:52:22 -0800 (PST)
>From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
>Subject: Re:  Template/function libraries for measurement units.
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>
>> Yes, Dimitre's code demonstrates pure XSLT implementations with
>particular
>> attention to efficiency through the use of functional programming
>concepts.
>>
>> It may take some effort to figure out how to safely extract the
>templates you
>> need from the complete calculator application, but it is worth it, to
>get the
>> most portable solution.
>>
>
>Thank you Mike and Michael for mentioning FXSL.
>
>
>Conversion from degrees to radians is defined in the trignm.xsl module
>like this:
>
>  <xsl:variable name="deg2rads" select="$pi div 180"/>
>
>and further down:
>
>    <xsl:variable name="vRads"
>     select="(($pUnit = 'rad') * $pX)
>              + ((not($pUnit = 'rad')) * ($pX * $deg2rads))"/>
>
>which means, that when we want to conver $pX degrees to radians, we'll
>use:
>
>$pX * $deg2rads
>
>
>
>Conversion from radians to degrees is defined in the arctrignm.xsl
>module in a similar way:
>
>  <xsl:variable name="rad2degs" select="180 div $pi"/>
>
>and further down:
>
>    <!-- convert radians to degrees (when 'deg' specified) -->
>    <xsl:value-of
>     select="(($pUnit = 'rad') * $vradResult)
>              + ((not($pUnit = 'rad')) * ($vradResult * $rad2degs))"/>
>
>which means, that when we want to conver $pX radians to degrees, we'll
>use:
>
>$pX * $rad2degs
>
>
>If one needs to work also with minutes and seconds, then this can be
>added easily -- delete or multiply twice by 60.
>
>Should one wait (how long?) until an extension function is provided by
>his vendour or by a "standard extension function" and his vendour then
>implements it? And hope to be portable?
>
>Or just use the simple pure XSLT 1.0 expressions above?
>
>I think everybody can easily find the correct answer.
>
>
>=====
>Cheers,
>
>Dimitre Novatchev.
>http://fxsl.sourceforge.net/ -- the home of FXSL
>
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
>http://mailplus.yahoo.com



 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.