This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
It would be more consistent if EBV of xs:anyURI values worked as if they were xs:string values, rather than throwing type errors. Inasmuch as EBV is defined by reference to fn:boolean, and xs:anyURI values can in general be promoted to xs:string, this would seem to be the case. On the other hand, the rules given for fn:boolean speak of specific argument types and say that in any other case, a type error is raised. We believe an explicit clarification for xs:anyURI is in order here.
Whether the EBV extraction of xs:anyURI("example.org/") yields a type error or not, I think can be concluded like this: The argument type of fn:boolean is item()*. For this reason is no atomization or type promotion invoked, as according to the Function Conversion Rules in XPath20. Thus, the body of fn:boolean is passed an xs:anyURI instance, and according to fn:boolean's definition xs:anyURI are not EBV-extractable and hence yields an error. However: * Saxon accepts "<xsl:if test="xs:anyURI('example.org')">" and evaluates it to true, so this is an indication in another direction. * Type promotion, especially involving xs:anyURI, is vague in other areas as well. It looks like these are editorial bugs, not design problems or unconsidered aspects. It will be interesting to hear what the WG members say. If one looks on prior cases(such as #2324), it wouldn't surprise me if EBV extraction from xs:anyURI should be allowed. I wonder if it makes sense though for xs:anyURI. A similar case is: http://www.w3.org/Bugs/Public/show_bug.cgi?id=2324 I agree clarification would be helpful. An example involving xs:anyURI and fn:boolean would likely settle all confusion. Cheers, Frans
I think there's no doubt that in the current specs it's a type error to get the EBV of an xs:anyURI value. I don't feel strongly either way about changing it. Contrary to what Frans reports, Saxon 8.6 does report this error on xsl:if - though only at run-time (the static type checking can't yet handle a required type of this complexity) Michael Kay
Frans is right about Saxon after all, it is sometimes (incorrectly) allowing an anyURI in an EBV context.
Resolved to fix this issue by adding an explicit reference to xs:anyURI to bullet 4 in the description of fn:boolean in F&O (15.1.1) and where that text is repeated in the language document in the description of EBV (2.4.3)
An observation, in case anyone missed it (it didn't come up in discussion): this change also affects the rules for evaluating predicates, which are very similar to the EBV rules (and defined by relation to the EBV rules). Michael Kay
Fixed by adding an explicit reference to xs:anyURI to bullet 4 in the description of fn:boolean in F&O (15.1.1) as decided on the 2006-01-03 telcon.
Before closing this, please check that the changes to the language book (which repeats the rules for EBV) have also been made.