[Bug 5914] New: [FS]: Normalization of treat as

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5914

           Summary: [FS]: Normalization of treat as
           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


In Bug 5672, it was clarified that treat as can be evaluated lazily.

I'm fairly sure that the input of a typeswitch expression _can't_ be evaluated
lazily, yet treat as is specified in FS to be normalized to a typeswitch
expression:

[Expr treat as SequenceType]Expr
==
typeswitch ([ Expr ]Expr)
  case $fs:new as SequenceType return $fs:new
  default $fs:new return fn:error()

Is this normalization rule correct?

With the function:

declare function local:items()
{
  (1, 2, 3, "four")
};

consider:

(local:items() treat as xs:integer*)[position() lt 4]

and:

(typeswitch ( local:items() )
 case $new as xs:integer* return $new
 default return fn:error())[position() lt 4]


-- 
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 12:11:04 UTC