This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

URL Encoding


Hi All,
  Thanks to all who helped my url encoding problem, even though I had
trouble getting it working :)
Here is a solution that I found, although it relies on the msxsl namespace.

 <msxsl:script language="JScript" implements-prefix="user">
 <![CDATA[
    function urlEncode(strURL)


     return encodeURI(strURL);

    }
    ]]>
 </msxsl:script>

..that's it, and then down below I call it like this:

<xsl:value-of select="user:urlEncode(string(//parentCategory))" />

one weird problem that I had was that I *had* to use the string function, I
thought that (//parentCategory) would have been fine as is, but I was
mistaken.

The script relies on version 5.5 of the Microsoft Script Engine.

Regards,
Serdar


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]