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

Frustration High

Subject: Frustration High
From: "Christopher Jacob" <chris.jacob@xxxxxxxxxxxxx>
Date: Wed, 2 Jun 2004 13:48:40 -0400
java toradians
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><!--centering 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



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.