[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: "Julian Reschke" <julian.reschke@xxxxxx>
Date: Thu, 7 Mar 2002 13:17:01 +0100
xsl counter xml msxsl script
Hi,

you are using script to implement a counter. This is not necessary and it
may fail because XSLT doesn't guarantee you a specific invocation order.

Instead, just use:

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



> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Alia Mikati
> Sent: Thursday, March 07, 2002 1:16 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xsl:script (again)
>
>
> Hi again,
> this is my code and I used the method u told me about.
>
> <?xml version='1.0'?>
> <xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:msxsl="urn:schemas-microsoft-com:xslt"
> xmlns:xslscript="http://mycompany.com/mynamespace"  version="1.0">
> <msxsl:script language="vbScript" implements-prefix="xslscript">
>   <![CDATA[
>    SalesPosition=1
>    function SalesPos()
>      SalesPos=SalesPosition
>      SalesPosition=SalesPosition+1
>    end function
>   ]]>
> </msxsl:script>
> <xsl:template match="/">
>  <table border="1">
>   <tr>
>    <td><b>Position</b></td>
>    <td><b>Name</b></td>
>    <td><b>Units Sold</b></td>
>   </tr>
>   <xsl:apply-templates select="SalesDept" />
>  </table>
> </xsl:template>
> <xsl:template match="SalesDept">
>  <xsl:apply-templates select="Salesperson" />
> </xsl:template>
> <xsl:template match="Salesperson">
>  <tr>
>   <td> <xsl:value-of select="xslscript:SalesPos() "/></td>
>   <td> <xsl:value-of select="Name" /> </td>
>   <td> <xsl:value-of select="Sales" /> </td>
>  </tr>
>  </xsl:template>
> </xsl:stylesheet>
>
> 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
>
> Can u help me plz and tell me what's the problem????
> Thx
>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.