title: calling function from XSLT Error: Namespace does not contain any functions
body: <p>i want call the  vbscript function:</p>
  
  <pre><code> VBCustomScript 
  </code></pre>
  
  <p>inside xslt file but i get the following error:</p>
  
  <pre><code> Error (0x80004005): Namespace 'extra-functions' does not contain any functions. 
  </code></pre>
  
  <p>please any help?</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsl:stylesheet version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:x="http://www.w3.org/1999/XSL/Transform-alternate" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:lsd="http://www.lodestar.com"
      xmlns:i="urn:ls-i18n-formatter"
      exclude-result-prefixes="xsl xsd lsd"&gt;
  
  &lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/&gt;
  &lt;xsl:namespace-alias stylesheet-prefix="x" result-prefix="xsl"/&gt;
  &lt;xsl:param name="Exclude"&gt;UIDACCOUNT&lt;/xsl:param&gt;
  &lt;xsl:param name="Include"&gt;UIDACCOUNT&lt;/xsl:param&gt;
  &lt;xsl:variable name="DateSep" select="i:GetLocaleData(29)" /&gt;
  &lt;xsl:param name="RslvPrefix"&gt;RSLV_&lt;/xsl:param&gt;
  &lt;xsl:param name="RslvSuffix"&gt;.RSLV&lt;/xsl:param&gt;
  &lt;xsl:template match="xsd:element"&gt;
      &lt;x:stylesheet version="1.0"
      xmlns:i="urn:ls-i18n-formatter"
      xmlns:ms="urn:schemas-microsoft-com:xslt"
      xmlns:user="http://www.lodestarcorp.com/user"
      xmlns:extra="urn:extra-functions"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      exclude-result-prefixes="i ms user extra msxml"
      &gt; 
  
  &lt;x:output method="html" version="1.0" encoding="UTF-8" indent="yes"/&gt;
  
  &lt;ms:script language="JScript" implements-prefix="user"&gt;
      function MonthYear(val, sep) {
          var mon= "00" + (val &amp;amp; 0x000f);
          return !val ? "" : ("" + mon.substr(mon.length - 2) + sep + ((val &amp;amp; 0xffff) &amp;gt;&amp;gt; 4));
      }
  &lt;/ms:script&gt;
  &lt;msxsl:script xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  language="VBScript" implements-prefix="extra"&gt;
      function VBCustomScript(str)
          VBCustomScript= "test"
      end function 
  &lt;/msxsl:script&gt;
  &lt;x:template match="ENTITIES"&gt;
      &lt;xsl:variable name="LookupSecondary" select="xsd:keyref/xsd:field[position() &amp;gt; 1]/@xpath"/&gt;
      &lt;xsl:variable name="Fields" 
          select="xsd:complexType/xsd:attribute[not(contains($Exclude, @name) or @lsd:ISUID='Y' or @name= 'COLLECTIONHISTNUM' or @name='LSUSER' or @name='LSTIME' or @type = 'BLOB' or @type = 'Bit' or @name = $LookupSecondary)]"/&gt;
  
      &lt;table class="Stripy" cellpadding="2" cellspacing="0" border="0"&gt;
          &lt;thead&gt;&lt;tr&gt;
              &lt;th onclick='event.cancelBubble=true'&gt;&amp;#160;&lt;/th&gt;
              &lt;xsl:if test="@name[.='METERHISTORY']"&gt;
                  &lt;th&gt;&amp;#160;&lt;/th&gt;
              &lt;/xsl:if&gt;
              &lt;xsl:for-each select="$Fields"&gt;
                  &lt;xsl:sort select="@lsd:COLUMNNUMBER" data-type="number" /&gt;
                  &lt;th nowrap="" onclick=""&gt;
                      &lt;xsl:if test="@type != 'XML_DOCUMENT'"&gt;
                          &lt;xsl:attribute name="onclick"&gt;NavSort('&lt;xsl:value-of select="@name"/&gt;')&lt;/xsl:attribute&gt;
                      &lt;/xsl:if&gt;
                      &lt;xsl:variable name="Lookup" select="../../xsd:keyref[xsd:field/@xpath=current()/@name]"/&gt;
                      &lt;xsl:variable name="LookupTable" select="//xsd:element[xsd:key/@name=$Lookup/@refer]"/&gt;
  
                      &lt;xsl:choose&gt;
                            &lt;xsl:when test="$Lookup"&gt;
                              &lt;xsl:value-of select="i:FM(concat('tables/',$LookupTable/@name, '/ref/', ../../@name, '/', @name))"/&gt;
                            &lt;/xsl:when&gt;
                            &lt;xsl:when test="@name='URL_CONVERTITORE'"&gt;
                              Foto Co
                            &lt;/xsl:when&gt;
                            &lt;xsl:when test="@name='URL_MISURATORE'"&gt;
                              Foto Mi
                            &lt;/xsl:when&gt;
                            &lt;xsl:otherwise&gt;
                              &lt;xsl:value-of select="i:FM(concat('tables/', ../../@name, '/fld/', @name))"/&gt;
                            &lt;/xsl:otherwise&gt;
                      &lt;/xsl:choose&gt;
                  &lt;/th&gt;
              &lt;/xsl:for-each&gt;
              &lt;th nowrap="" onclick=""&gt;
              CAMPO DI PROVA
              &lt;/th&gt;
          &lt;/tr&gt;&lt;/thead&gt;
          &lt;tbody&gt;
              &lt;xsl:variable name="Params" select="xsd:complexType/xsd:attribute[@lsd:ISUID='Y' or (@lsd:ISIDENTITY='Y' and not(../xsd:attribute[@lsd:ISUID='Y']))]"/&gt;
              &lt;x:for-each select="*"&gt;
                  &lt;tr class="r{{position() mod 2}}" onclick="event.cancelBubble=true;" id="r{{position()}}"&gt;
                      &lt;td&gt;
                      &lt;a&gt;
                          &lt;xsl:attribute name="href"&gt;javascript:Edit('&lt;xsl:for-each select="$Params"&gt;
                                  &lt;xsl:value-of select="@name"/&gt;:{&lt;xsl:choose&gt;
                                      &lt;xsl:when test="@type='UID' or @type='Small_UID'"&gt;substring-before(concat(@&lt;xsl:value-of select="@name"/&gt;, ":"), ":")&lt;/xsl:when&gt;
                                      &lt;xsl:otherwise&gt;@&lt;xsl:value-of select="@name"/&gt;&lt;/xsl:otherwise&gt;
                                  &lt;/xsl:choose&gt;}&lt;xsl:if test="position() &amp;lt; last()"&gt;;&lt;/xsl:if&gt;
                              &lt;/xsl:for-each&gt;')
                          &lt;/xsl:attribute&gt;[...]
                      &lt;/a&gt;
                              &lt;xsl:variable name="Params1" select="xsd:complexType/xsd:attribute[@name='UIDREAD']"/&gt;
                              &lt;input type = "checkbox" id="{{position()}}"  onclick="change(id);"&gt;
                                  &lt;xsl:attribute name="value"&gt;{
                                      @&lt;xsl:value-of select="$Params1/@name"/&gt;
                                  }&lt;/xsl:attribute&gt;
                                  &lt;xsl:attribute name="name"&gt;uidread&lt;/xsl:attribute&gt;
                              &lt;/input&gt;
                      &lt;/td&gt;
                      &lt;xsl:if test="@name[.='METERHISTORY']"&gt;
                          &lt;td&gt;
                              &lt;a href="#"&gt;
                              &lt;xsl:attribute name="onclick"&gt;ShowMeterRead('{@UIDMETERHISTORY}')&lt;/xsl:attribute&gt;
                              &amp;lt;...&amp;gt;
                              &lt;/a&gt;
                          &lt;/td&gt;
                      &lt;/xsl:if&gt;
                      &lt;xsl:for-each select="$Fields"&gt;
                          &lt;xsl:sort select="@lsd:COLUMNNUMBER" data-type="number" /&gt;
                          &lt;xsl:variable name="Type" select="//xsd:simpleType[@name=current()/@type]"/&gt;
                          &lt;xsl:variable name="Field" select="."/&gt;
                          &lt;td align="center"&gt;
                              &lt;xsl:choose&gt;
  
                                  &lt;xsl:when test="$Type//xsd:enumeration"&gt;
                                      &lt;x:choose&gt;
                                          &lt;xsl:for-each select="$Type//xsd:enumeration"&gt;
                                              &lt;!-- GESTIONE DEL TIPO MITTENTE --&gt;
                                              &lt;x:when test="@{$Field/@name} = '{@value}' and '{$Type/@name}' = 'ITGp2_SENDERTYPE_DOMMD'"&gt;
                                                &lt;xsl:value-of select="concat($Type/@name, '@', @value)"/&gt;
                                              &lt;/x:when&gt;
  
                                              &lt;x:when test="@{$Field/@name} = '{@value}' and '{$Type/@name}' != 'ITGp2_SENDERTYPE_DOMMD'"&gt;                        
                                                &lt;xsl:value-of select="i:FM(concat('types/typename[@id=&amp;quot;', $Type/@name, '&amp;quot;]/value[@id=&amp;quot;', @value, '&amp;quot;]'))"/&gt;
                                              &lt;/x:when&gt;
                                          &lt;/xsl:for-each&gt;
                                            &lt;x:when test="'{$Field/@name}' = 'SENDERTYPE'"&gt;
                                              &lt;x:value-of select="concat('ITGp2_SENDERTYPE_DOMMD@',@{@name})" /&gt;
                                            &lt;/x:when&gt;
                                          &lt;x:otherwise&gt;&lt;x:value-of select="@{@name}" /&gt;&amp;#160;&lt;/x:otherwise&gt;
                                      &lt;/x:choose&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;!--Aggiunta F. Perricone per fotoletture in data 21/02/2011--&gt;
                                  &lt;xsl:when test="@name='URL_MISURATORE' or @name='URL_CONVERTITORE'"&gt;
                                    &lt;x:if test="(@{@name})!=''"&gt;
                                      &lt;xsl:variable name="Params1" select="xsd:complexType/xsd:attribute[*]"/&gt;
                                      &lt;img style="cursor:hand" src="../cust_facility/images/fotocamera.png" alt="Fotolettura"&gt;
                                        &lt;xsl:attribute name="onclick"&gt;javascript : ShowPhoto('&lt;xsl:value-of select="@name"/&gt;;&lt;xsl:for-each select="$Fields"&gt;
                                          &lt;xsl:if test="@name='STOPREADTIME' or @name='STOPREADING' or @name='CORRSTOPREAD' or @name='UIDMETER' or @name='UIDREADSHEET'"&gt;
                                          &lt;xsl:value-of select="@name"/&gt;|{&lt;xsl:choose&gt;
                                            &lt;xsl:when test="@type='UID' or @type='Small_UID'"&gt;
                                              substring-before(concat(@&lt;xsl:value-of select="@name"/&gt;, "|"), "|")
                                            &lt;/xsl:when&gt;
                                            &lt;xsl:otherwise&gt;
                                              @&lt;xsl:value-of select="@name"/&gt;
                                            &lt;/xsl:otherwise&gt;
                                          &lt;/xsl:choose&gt;}&lt;xsl:if test="position() &amp;lt; last()"&gt;;&lt;/xsl:if&gt;
                                          &lt;/xsl:if&gt;
                                        &lt;/xsl:for-each&gt;')&lt;/xsl:attribute&gt;&lt;/img&gt;
                                    &lt;/x:if&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;!--FINE Aggiunta F. Perricone per fotoletture in data 21/02/2011--&gt;
                                  &lt;xsl:when test="@type='UID' or @type='Small_UID'"&gt;&lt;x:value-of select=" @{@name}{$RslvSuffix} "/&gt;&lt;/xsl:when&gt;
                                  &lt;xsl:when test="@type = 'Float' or @type = 'Real'"&gt;
                                      &lt;x:value-of select="@{@name}"/&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test="$Type/xsd:restriction/@base='xsd:decimal'"&gt;
                                      &lt;x:value-of select="i:FR( @{@name}, {$Type/xsd:restriction/xsd:fractionDigits/@value}, 1 )"/&gt;
                                  &lt;/xsl:when&gt;
                                  &lt;xsl:when test="@type = 'Date'"&gt;&lt;x:value-of select="i:FD(@{@name})"/&gt;&lt;/xsl:when&gt;
                                  &lt;xsl:when test="@type = 'Timestamp'"&gt;&lt;x:value-of select="i:FD(@{@name}, 2, 4)"/&gt;&lt;/xsl:when&gt;
                                  &lt;xsl:when test="@type = 'Bill_Month'"&gt;
                                      &lt;x:if test="@{@name}"&gt;
                                          &lt;x:value-of select="user:MonthYear(number(@{@name}), '{$DateSep}')"/&gt;
                                      &lt;/x:if&gt;
                                  &lt;/xsl:when&gt;
                              &lt;xsl:otherwise&gt;
                              &lt;x:value-of select="@{@name}" /&gt;
                              &lt;/xsl:otherwise&gt;
                              &lt;/xsl:choose&gt;&amp;#160;
                          &lt;/td&gt;
                      &lt;/xsl:for-each&gt;
                      &lt;td&gt;
                       &lt;xsl:value-of select="extra:VBCustomScript(string(@UIDMETERHISTORY))"/&gt; 
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/x:for-each&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
  &lt;/x:template&gt;
  &lt;/x:stylesheet&gt;
  &lt;/xsl:template&gt;
  &lt;xsl:template match="text()"/&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>