[Bug 5915] New: [FS] rules for XPST0005


           Summary: [FS] rules for XPST0005
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Formal Semantics
        AssignedTo: jmdyck@ibiblio.org
        ReportedBy: tim@cbcl.co.uk
         QAContact: public-qt-comments@w3.org

The text in section 4 of FS states:

During static analysis, it is a type error for an expression to have the empty
type, except for the following expressions and function calls:

    * Empty parentheses (), which denote the empty sequence.
    * The fn:data function and all functions in the fs namespace applied to
empty parentheses ().
    * Any function which returns the empty type.

Consider the query:

1 + ()

This normalizes to:

fs:plus(fs:convert-operand(data(1), 1), 
        fs:convert-operand(data(()), 1)))

Although the arguments to fs:plus as written include (), in the normalized form
this is not the case.  However, I suspect that the intention of these rules was
to allow this query to pass without error.  

Following the above rules, data( () ) does not trigger an error, but has the
static type 'empty'.

In fs:convert-operand(data(()), 1), fs:convert-operand triggers an XPST005
error because it is being applied to data( () ) and not to ().

Could you please clarify?

Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Wednesday, 30 July 2008 15:46:18 UTC