Project

Profile

Help

internal use of string-join?

Added by Anonymous about 19 years ago

Legacy ID: #3061167 Legacy Poster: marcvc (marcvc)

Michael, consider the following query (this is not the one which triggered the issue originally ;-)): <e a="{avg(<e>1</e>)}"/> Saxon 8.3 reports: XP0006: Required type of first argument of string-join() is xs:string; supplied value has type xs:double Thanks, Marc


Replies (1)

RE: internal use of string-join? - Added by Anonymous about 19 years ago

Legacy ID: #3061797 Legacy Poster: Michael Kay (mhkay)

I have logged the bug and supplied a source fix at https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1168608&amp;group_id=29872&amp;atid=397617 (The detail here is that Saxon generates a call on the string-join function to compute the results of a direct attribute constructor. The avg() function is used as the first argument to this function. The avg() function should be wrapped in a call on string() to convert the results to a string; but this hasn't happened, because the type inferencer has wrongly concluded that the result of avg(), after atomization, will be untypedAtomic, and therefore requires no conversion. In the event the result turns out to be a double, causing the spurious type error.) Thanks for reporting these problems. Michael Kay

    (1-1/1)

    Please register to reply