Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#438 anyURI to String promotion failure

v8.6.1
closed
Michael Kay
5
2012-10-08
2005-12-01
Michael Kay
No

Under some circumstances, when an xs:anyURI value is
supplied as an argument to a function whose required
type is String, a compile-time type error (XPTY0004)
is reported.

The problem occurs where it is not apparent during
initial type checking that the supplied value is an
xs:anyURI, but where this becomes apparent later as a
result of contextual analysis: for example, if the
argument is written as a path expression and analysis
of the path expression against a schema reveals that
the supplied value will be an xs:anyURI.

Circumvention: cast the value explicitly to a string,
using the string() function.

[Source code fixed, test cases satype001 and
satype002 added.]

Discussion