I talked to Markos and there are some more issues here. 1. The function should probably go into the static context instead of the dynamic context. 2. It really depends on what you want to cast to. In general, the target type for casting is a sequence type (e.g. node()*, or xs:string?). As already mentioned, this cannot be returned as an item other than a string. If you did that, it pushes a lot of effort to the consumer because he needs to parse the sequence-type. There are two alternatives: - xqxq:variable-type-name($name as xs:QName) as xs:QName? which returns the name of type (e.g. no node()*) - xqxq:variable-sequence-type($name as xs:QName) as xs:string? which returns the sequence type as a string.
It really depends on exactly what the user needs. I would go with variable-type-name if that's sufficient for all FOTS use cases. -- https://code.launchpad.net/~zorba-coders/zorba/bug1064978/+merge/150696 Your team Zorba Coders is subscribed to branch lp:zorba. -- Mailing list: https://launchpad.net/~zorba-coders Post to : firstname.lastname@example.org Unsubscribe : https://launchpad.net/~zorba-coders More help : https://help.launchpad.net/ListHelp