Yes Michael, problem is with return value not with the function argument.
I rectified it. Earlier I thought passed arguments are not able to cast
from string to QName.
But actual problem was with return value.


On Tue, May 28, 2013 at 1:58 PM, Michael Kay <[email protected]> wrote:

> I wonder if the problem is with the function return value rather than with
> its arguments?
>
> What is the body of the function?
>
> Michael Kay
> Saxonica
>
>
> On 28 May 2013, at 07:51, Kunal Chauhan wrote:
>
> I tried to run this query with two processors DataDirect and Saxon.
> But under both processors it gives me an error.
> Under DataDirect I am facing above mentioned error and
> and Under Saxon, it give me below error
>  XPTY0004: Cannot convert string to type {xs:QName}
>
>
>
> On Mon, May 27, 2013 at 9:13 PM, David Lee <[email protected]> wrote:
>
>>  Which XQuery processor is this ?****
>>
>> This looks like it should work.  Is it possible you are calling the
>> function in several places and this is not the instance where it is failing
>> ?****
>>
>> ** **
>>
>> ** **
>>
>> ----------------------------------------****
>>
>> David A. Lee****
>>
>> [email protected]****
>>
>> http://www.xmlsh.org****
>>
>> ** **
>>
>> *From:* [email protected] [mailto:[email protected]] *On
>> Behalf Of *Kunal Chauhan
>> *Sent:* Monday, May 27, 2013 11:17 AM
>> *To:* [email protected]
>> *Subject:* [xquery-talk] Type 'element(*, xs:untyped)' cannot be cast to
>> type 'xs:QName'.****
>>
>> ** **
>>
>> Hi,****
>>
>> I am trying to pass QName to function as an argument, at that time I am
>> getting following error.
>>
>> Static type error. Type 'element(*, xs:untyped)' cannot be cast to type
>> 'xs:QName'.****
>>
>> Below is XQuery function calling ** **
>>
>> tryToPassQname($ele ,  QName('http://www.myCompany.com/20120831','location')
>> )
>> ****
>>
>> ** **
>>
>> Below is a function signature :****
>>
>> tryToPassQname($item as node(), $qname as xs:QName) as xs:QName )
>>
>> ****
>>
>> can any one tell me what's going on wrong over here ?****
>>
>> Thanks and Regards,****
>>
>> -- ****
>>
>> *Kunal Chauhan*****
>>
>> [email protected]****
>>
>> [+918655517141]****
>>
>
>
>
> --
> *Kunal Chauhan*
> [email protected]
> [+918655517141]
> [+919904983614]
>  _______________________________________________
> [email protected]
> http://x-query.com/mailman/listinfo/talk
>
>
>


-- 
*Kunal Chauhan*
[email protected]
[+918655517141]
[+919904983614]
_______________________________________________
[email protected]
http://x-query.com/mailman/listinfo/talk

Reply via email to