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

RE: Using msxsl:script or EXSLT function to define a f

Subject: RE: Using msxsl:script or EXSLT function to define a function
From: "Dion Houston" <dionh@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 18 Jun 2003 05:39:59 -0700
using msxsl script
Hi Claudio:

Most of the problem is that this isn't valid XML :)

First you need to change the third line to exclude-result-prefixes="..." (you're missing the equals sign).  The other issue you're having is that you have accented characters encoded in ANSI.  The basic rule about encoding is that if an encoding can't be determined by other means, assume it's UTF-8.  If you take your stylesheet into notepad and save as UTF-8 that problem goes away.

Finally, why do you have an "XML" element as the root?  Any case combination of XML is reserved.



-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Claudio Russo
Sent: Wednesday, June 18, 2003 5:07 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Using msxsl:script or EXSLT function to define a function

Yes, sorry, but I posted before with all the info, and
I guess it was too much information, so I did it
briefly this last time to make it clear.

Lets put the code back, maybe you can answer to it.
Here goes...

<XML ID="XSLHeader">
  <xsl:stylesheet version="1.0"
exclude-result-prefixes "xsl msxsl" 

	<msxsl:script language="javascript"
	   function factorial(n)
			if (n == '1')
				{ return ( 1 ) }
				{ return ( n * factorial(n - 1) ) }

   		<xsl:param name="sexo"/>
   		<xsl:param name="categ"/>
   		<xsl:param name="anio"/>
		<xsl:template match="portfolio">
        	<table border="2" width="100%" height="6">
            		<td class="bg">
select="description"/> del <xsl:value-of
select="$anio"/> - <xsl:value-of select="$categ"/>
              		<H3>Actualizado el
<xsl:apply-templates select="date"/>
				 		<H3>Factorial <xsl:value-of
						<P>Presione sobre los encabezados para ordenar
por dicho campo.</P>
		<xsl:template match="date">
    		<xsl:value-of select="ms:format-date(., 'd',
SP_ar)"/> de <xsl:value-of select="ms:format-date(.,
'MMMMM, yyyy', SP_ar)"/>
			a las <xsl:value-of select="ms:format-time(.,
'hh:mm tt')"/>



I don't know why, but I'm not able to run the
javascript and the page presents an error.


--- Michael Kay <mhk@xxxxxxxxx> wrote:
> > Does anybody know how to use msxsl:script to
> define a 
> > javascript function, or EXSLT function definition?
> > 
> > I'm not able to use it inside xsl: without having
> > error.
> Yes, lots of people know, and if you show them what
> you're doing,
> they'll be able to tell you where you are going
> wrong.
> Michael Kay
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list

Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

 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


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.
First Name
Last Name
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.