This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 1746 - [FS] editorial: 7.1.4 The fs:convert-simple-operand function
Summary: [FS] editorial: 7.1.4 The fs:convert-simple-operand function
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: Formal Semantics 1.0 (show other bugs)
Version: Last Call drafts
Hardware: All All
: P2 minor
Target Milestone: ---
Assignee: Michael Dyck
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
Depends on:
Reported: 2005-07-19 05:31 UTC by Michael Dyck
Modified: 2007-09-18 23:28 UTC (History)
1 user (show)

See Also:


Description Michael Dyck 2005-07-19 05:31:58 UTC
7.1.4 The fs:convert-simple-operand function

"$actual as item?"
    In the only use of fs:convert-simple-operand in the FS, the first
    argument is the result of a call to fn:data, which means it must be of
    type "xdt:anyAtomicType*". So "item*" could be narrowed to

"The dynamic semantics of this function are as follows ..."
    These don't match the function conversion rules of XQuery 3.1.5.
    Similarly, STA / rule 1 is insufficient.
Comment 1 Jerome Simeon 2006-02-21 17:51:44 UTC
About the first point: I agree, the type can be made more precise. Fixed for the
next version of the document.

About the second point: I believe the definition of fs:convert-simple-operand is
correct. The function conversion rules in XQuery are as follows:

   1. Atomization is applied to the given value, resulting in a sequence of
atomic values.
   2. Each item in the atomic sequence that is of type xdt:untypedAtomic is cast
to the expected atomic type. For built-in functions where the expected type is
specified as numeric, arguments of type xdt:untypedAtomic are cast to xs:double.
   3. For each numeric item in the atomic sequence that can be promoted to the
expected atomic type using numeric promotion as described in B.1 Type Promotion,
the promotion is done.
   4. For each item of type xs:anyURI in the atomic sequence that can be
promoted to the expected atomic type using URI promotion as described in B.1
Type Promotion, the promotion is done.

1. is handled by the introduction of fn:data() during normalization.
3. and 4. are handled by the dynamic semantics of function calls.

so fs:convert-simple-operand only deals with 2. something that could be made
clearer here is fact that in the case of built-in function with an expected type
of numeric, the prototypical value should be of type xs:double.

I added a note to that effect for clarification in 4.1.5. Function calls.

- Jerome

Comment 2 Michael Dyck 2006-10-05 19:17:18 UTC
I said:
> "$actual as item?"
>     ... "item*" could be narrowed to "xdt:anyAtomicType*".

You changed it to "xs:anyAtomicTypeAtomic*". Delete the second "Atomic" (twice).
Comment 3 Jerome Simeon 2007-01-16 17:59:46 UTC
- Jerome
Comment 4 Michael Dyck 2007-05-09 22:17:26 UTC
Not quite; there were two occurrences of xs:anyAtomicTypeAtomic, and only one was corrected to xs:anyAtomicType.
Comment 5 Michael Dyck 2007-09-18 23:28:31 UTC
This issue (re xs:anyAtomicTypeAtomic) has been entered as FS erratum E004.

A fix has been committed to the source files for the next edition of the FS
document. Consequently, I'm marking this issue resolved-FIXED, and CLOSED.