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

RE: Frustration High

Subject: RE: Frustration High
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 2 Jun 2004 18:57:34 +0100
xsl variable math
Extension functions depend on which processor you are using, so that's the
first thing you should tell us.

It's also possible of course that you aren't using the processor you think
you are...

Michael Kay 

> -----Original Message-----
> From: Christopher Jacob [mailto:chris.jacob@xxxxxxxxxxxxx] 
> Sent: 02 June 2004 17:49
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Frustration High
> 
> Hey Guys,
> 
> I am trying to create a pie chart in svg from a very simple 
> xml file. When I
> try to create the file I get...
> 
> file:/C:/Documents and Settings/Chris/My 
> Documents/EyeStreet/Mockup/Rev2/XSL
> Files/CreatePie.xslt; Line #54; Column #-1; XSLT Error
> (javax.xml.transform.TransformerException):
> javax.xml.transform.TransformerException: java.lang.ClassNotFoun
> dException: java/java/lang/Math
> 
> Here is part of the code...
> 
> <xsl:template match="SITE">
> 		<xsl:param name="color" select="'indianRed'"/>
> 		<xsl:param name="total" select="'0'"/>
> 		<xsl:param name="runningTotal" select="'0'"/>
> 		<xsl:variable name="number" select="."/>
> 		<xsl:variable name="currentAngle"
> select="java:java.lang.Math.toRadians(($number div $total) * 360.0)"/>
> 		<xsl:variable name="halfAngle"
> select="java:java.lang.Math.toRadians((($number div 2) div $total) *
> 360.0)"/>
> 		<xsl:variable name="rotation" select="270 + (360.0 *
> ($runningTotal div $total))"/>
> 		<xsl:variable name="x1"
> select="java:java.lang.Math.cos($halfAngle) * 70"/>
> 		<xsl:variable name="y1"
> select="java:java.lang.Math.sin($halfAngle) * 70"/>
> 		<xsl:variable name="cosTheta"
> select="java:java.lang.Math.cos(java:java.lang.Math.toRadians(
> $rotation))"/>
> 		<xsl:variable name="sinTheta"
> select="java:java.lang.Math.sin(java:java.lang.Math.toRadians(
> $rotation))"/>
> 		<path style="fill:{$color};stroke:black;stroke-width:1;
>           fillrule:evenodd;stroke-linejoin:bevel;">
> 			<xsl:attribute
> name="transform"><xsl:text>translate(150,150)</xsl:text><!--ce
> ntering the
> circle in the non-legend 
> space--><xsl:text>rotate(</xsl:text><xsl:value-of
> select="$rotation"/><xsl:text>)</xsl:text></xsl:attribute>
> 			<xsl:attribute name="d"><xsl:text>M 100 
> 0 A 100 100
> 0 </xsl:text><!-- to change size, change all instances of
> 100--><xsl:choose><xsl:when test="$currentAngle > 3.14"><xsl:text>1
> </xsl:text></xsl:when><xsl:otherwise><xsl:text>0
> </xsl:text></xsl:otherwise></xsl:choose><xsl:text>1 
> </xsl:text><xsl:value-of
> select="java:java.lang.Math.cos($currentAngle) * 100"/><xsl:text>
> </xsl:text><xsl:value-of 
> select="java:java.lang.Math.sin($currentAngle) *
> 100"/><xsl:text> L 0 0 Z</xsl:text></xsl:attribute>
> 		</path>
> 		<text style="text-anchor:middle">
> 			<xsl:attribute
> name="transform"><xsl:text>translate(150,150) 
> </xsl:text></xsl:attribute>
> 			<xsl:attribute name="x"><xsl:value-of 
> select="($x1 *
> $cosTheta) - ($y1 * $sinTheta)"/></xsl:attribute>
> 			<xsl:attribute name="y"><xsl:value-of 
> select="($x1 *
> $sinTheta) + ($y1 * $cosTheta)"/></xsl:attribute>
> 			<xsl:value-of select="round(100 * ($number div
> $total))"/>
> 			<xsl:text>%</xsl:text>
> 		</text>
> 	</xsl:template>
> 
> #######################################
> 
> It seems to me that this is a problem with Java paths, but I 
> can't seem to
> get it figured out. Any help would be appreciated.
> 
> Thanks
> 
> Chris
> 
> 
> 
> --+------------------------------------------------------------------
> 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@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 
> 



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.