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

Re: xsl:script (again)

Subject: Re: xsl:script (again)
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 7 Mar 2002 12:23:20 +0000
Re:  xsl:script (again)
Hi Alia,

> But I got as output: SalesPosition=1 function SalesPos()
> SalesPos=SalesPosition SalesPosition=SalesPosition+1 end function
> function calcul(node) m=node.childnodes.item(1).text
> n=node.childnodes.item(2).text calcul=m*n end function

It looks as though the stylesheet isn't being interpreted properly. It
could be a couple of things:

  - are you accidentally running the transformation on the stylesheet
    rather than on the source document?
  - are you using MSXML2, which doesn't support XSLT?

You could try adding an extension-element-prefixes attribute to the
xsl:stylesheet element to state that the prefix 'msxsl' is being used
for extension elements, though I don't think that would make a
difference.

By the way, your function seems a little peculiar, since you can
easily get the position of a particular Salesperson through the
position() function. Rather than using your xslscript:SalesPos()
function, why not just do:

<xsl:template match="Salesperson">
 <tr>
  <td><xsl:value-of select="position()" /></td>
  <td><xsl:value-of select="Name" /></td>
  <td><xsl:value-of select="Sales" /></td>
 </tr>
</xsl:template>

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.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.