I am using XSLT 1.0 and I am not supposed to use XSLT 2.0. 
I have the following xml in which the value of <prvNum> has some special characters.
<?xml version="1.0" encoding="UTF-8"?>
<root>
   <prvNum>SPECIAL#1&</prvNum>
</root>
Now I want to perform percent-encoding for the value of <prvNum>. For example the value should be changed as below after percent encoding:
SPECIAL%231%26
I am trying with the following code snippet, but the stylesheet is not compiling.
 <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:custom="http://youdomain.ext/custom" xmlns:msxsl="urn:schemas-microsoft-com:xslt" version="1.0">
   <msxsl:script language="JScript" implements-prefix="custom">function uriencode(string) {
 return encodeURIComponent(string);
}</msxsl:script>
   <!-- identity template -->
   <xsl:template match="@*|node()">
      <xsl:copy>
         <xsl:apply-templates select="@* | node()" />
      </xsl:copy>
   </xsl:template>
   <xsl:template match="prvNum">
      <prvNum>
         <xsl:copy-of select="@*" />
         <xsl:value-of select="custom:uriencode(text())" />
      </prvNum>
   </xsl:template>
</xsl:stylesheet>
Can anybody help me to fix the issue?