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

RE: Runng Script in Server-Side XSL causes Runtime Err

Subject: RE: Runng Script in Server-Side XSL causes Runtime Error
From: "Ivan Pedruzzi" <ivan@xxxxxxxxxxxxxxx>
Date: Thu, 15 Nov 2001 18:07:43 -0500
runng
I changed your call adding the XSL string function, and is working fine

       <xsl:value-of select="test:sZeroFillTo(string(dob/month),2)" />
 
Because the String Object fails to coerce the IXMLDOMNode, you end up
with a runtime-error


Ivan Pedruzzi
eXcelon Corporation
http://www.stylusstudio.com



> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Jibran Bisharat
> Sent: Wednesday, November 14, 2001 3:03 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Runng Script in Server-Side XSL causes Runtime Error
> 
> 
> The Situation:
>     I have a function called 
> sZeroFillTo(sStringToFill,nDigits) declared below.  I need to 
> fill zeros on months/days/years that aren't
>     zero filled (very simple).
> The Problem:
>     *********************ERROR RETURNED**********************
>     Microsoft JScript runtime error Wrong number of arguments 
> or invalid property
>     assignment line = 4, col = 3 (line is offset from the 
> start of the script block).
>     Error returned from property or method call.
> 
>     I have tried with and without the CDATA section, still errors...
> 
>     I can get the function to work if i return immediatetly 
> with what im passed in sStringToFill as follows:
>     function sZeroFillTo(sStringToFill,nDigits)
>     {
> 
>         return sStringToFill;
>      }
> 
> Does anyone know what i am doing wrong???? thanks
> Jibran.....
> 
> *****************XSL SNIPITS**********************************
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0"
>     xmlns:msxsl="urn:schemas-microsoft-com:xslt"
>     xmlns:test="http://mycompany.com/mynamespace">
> 
>  <msxsl:script language="JScript" implements-prefix="test"><![CDATA[
>   function sZeroFillTo(sStringToFill,nDigits)
>   {
>    var sReturn=new String(sStringToFill);
>     while (sReturn.length < nDigits)
>         sReturn="0"+sReturn;
>    return sReturn;
>   }]]>
> .
> .
> .
> <xsl:for-each select="record">
>    <tr>
>     <xsl:variable name="sDOB">
>      <xsl:if test="dob/month!=''">
>       <xsl:value-of select="test:sZeroFillTo(dob/month,2)" />
>       <xsl:value-of select="'/'"/>
>      </xsl:if>
>      <xsl:if test="dob/day!=''">
>       <xsl:value-of select="test:sZeroFillTo(dob/day,2)" />
>       <xsl:value-of select="'/'"/>
>      </xsl:if>
>      <xsl:if test="dob/year!=''">
>       <xsl:value-of select="test:sZeroFillTo(dob/year,4)" />
>       <xsl:value-of select="' '"/>
>      </xsl:if>
>     </xsl:variable>
> 
> 
>  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.