vbScript函数返回无法转换为XSL数据类型的值 [英] vbScript function returns a value that cannot be converted to an XSL data type

查看:100
本文介绍了vbScript函数返回无法转换为XSL数据类型的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I get the below error when I try to display XML data using XSL. The VBScript Function throws this error:

Function "MyFuctionName" returns a value that cannot be converted to an XSL data type. What could be the cause.
Snapshot of Code below: 1.XML

        <Client>
             <ClientID>34987886</ClientID>
               <LnkSeqNo>1</LnkSeqNo>
        </Client>

2.XSL code,function.

    Dim ClientID

    function SetClientID(ID)
        ClientID = ID
    end function

...

    <xsl:for-each select="Object/Client">
           <xsl:if test="LnkSeqNo[. = '1' or . = '57']">
              <xsl:value-of disable-output-escaping="yes" select="vbs:SetClientID(string(ClientID))"/>
..
          </xsl:if>
    </xsl:for-each>

推荐答案

Pppssshh成功解决了这个问题。我的函数SetClientID(ID)没有返回值或没有初始化..所以我这样设置然后它工作。

Pppssshh managed to figure it out. my Function SetClientID(ID) wasnt returning a value or was not initialized..so I set it this way then it worked.
function SetClientID(ID)
       SetClientID=""
        ClientID = ID
    end function


这篇关于vbScript函数返回无法转换为XSL数据类型的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆