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

Re: XML, XST, and Javascript

Subject: Re: XML, XST, and Javascript
From: ケンジイ ムヤモト <kenjii.muyamoto@xxxxxxxxx>
Date: Thu, 18 Nov 2004 05:30:01 -0800
firefox xsl javascript
What XSLT Processor?  I just use Mozilla Firefox to render the XML and
XSLT file into a webpage.

Anyway, I figured it all out before I got this e-mail.  I'm using
xPath to do a bit of multiplying and such.  Before, I only knew that
XPath could do addition and subtraction.

-Kenji

On Thu, 18 Nov 2004 10:44:12 +0200, jarno.elovirta@xxxxxxxxx
<jarno.elovirta@xxxxxxxxx> wrote:
> Hi,
> 
> > help with the % and weight, I'll need to calculate multiplication.
> > Javascript seemed the logical way, but I can't figure out how to send
> 
> Why?
> 
> > =================================================================
> 
> 
> > XSLT:
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > <xsl:template match="/">
> > <html>
> > <head>
> >        <script type="text/javascript">
> >        <!--
> >                function percent(pom) {
> >                        var max = 100;
> >                        return pom * max;
> >                }
> >        //-->
> >        </script>
> 
> If you want to use extensions written in Javascript, you have to declare them as such. Right now you're just generating a Javascript block into you result tree. See your XSLT processors documentation on how to use extensions written in Javascript.
> 
> 
> 
> >        <title>Weight Chart</title>
> > </head>
> > <body>
> >        <xsl:for-each select="chart/chart-head">
> >
> >                <h1><xsl:value-of select="chart-title" /></h1>
> >        </xsl:for-each>
> >
> >        <xsl:for-each select="chart/chart-data">
> >                <table>
> >                        <tr>
> >                                <th>Exercise</th>
> >                                <th>Muscles</th>
> >
> >                <th>Max %</th>
> >                                <th>Weight</th>
> >                                <th>Reps</th>
> >                        </tr>
> >                <xsl:for-each select="exercise">
> >                        <tr>
> >                                <td><xsl:value-of
> > select="@title" /></td>
> >                                <td><xsl:value-of
> > select="muscles" /></td>
> >                                <td><xsl:value-of
> > select="max-percent" /></td>
> >                                <td><span onload="percent(<xsl:value-of
> > select="max-percent">)" /> Lbs.</td>
> 
> This is ill-formed XML. Again, check the documentation how to call extensions, I quess something in the lines of
> 
>   <span onload="{percent(max-percent)}" />
> 
> or just use XPath
> 
>   <span onload="{percent(max-percent * 100)}" />
> 
> Cheers,
> 
> Jarno

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.