Casting: Use Cases VS Specs

Hi,

There appears to be a mismatch between the XML Query Use Cases
and the Functions and Operators specs.

In the XML Query Use Cases W3C Working Draft 20 December 2001,
section 1.1.9.10 Q10, the example is:
    <results>
    {
        let $doc := document("prices.xml")
        for $t in distinct-values($doc//book/title)
        let $p := $doc//book[title = $t]/price
        return
          <minprice title={ $t/text() }>
    <price>{ min(decimal($p/text())) }</price>
    </minprice>
    }
    </results>

The expression "min(decimal($p/text()))" implies that the
cast decimal() can be applied to a sequence.

Yet nowhere in "XQuery 1.0 and XPath 2.0 Functions and Operators
W3C Working Draft 20 December 2001" is there such as cast.

Section 3.2.1 discusses a decimal() constructor that takes
a single string literal.
Section 14 discusses casting functions from primitives to primitives,
but not over sequences.

The intent of the use case is clear ... apparently the cast
should be applied to each element of the sequence.
But where is it in the specs?

Thanks,

Steve


========================================
Steve Sullivan    sullivan@mathcom.com

   Mathcom Solutions: Custom Software Development.
    * XML, XQuery, XSLT, Java, JDBC, J2EE, JSP, JNI, ...
    * Mathematical optimization, simulation, and modeling.

http://www.mathcom.com    303-494-7115
========================================

Received on Friday, 8 March 2002 12:23:33 UTC