Click here to Skip to main content
15,891,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
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>
Posted

1 solution

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.
VB
function SetClientID(ID)
       SetClientID=""
        ClientID = ID
    end function
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900