W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2008

[Bug 5672] Evaluation of treat as

From: <bugzilla@farnsworth.w3.org>
Date: Thu, 01 May 2008 08:16:07 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1JrTxX-0000TY-7r@farnsworth.w3.org>

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

           Summary: Evaluation of treat as
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: tim@cbcl.co.uk
         QAContact: public-qt-comments@w3.org


Could you please clarify the behaviour of treat as.  Consider the query:

declare function local:result($values as xs:integer*)
{
  if ( current-date() eq xs:date('2008-12-31') )
  then $values[4]
  else $values[position() lt 4]
};

let $input := ( (1, 2, 3, 'four') treat as xs:integer* ) return
  local:result($input)

Is 'treat as' required to check its input argument in one go,
or is it permissible to evaluate it as items from its result sequence are used?
 So in this example, is the query only guaranteed to fail with XPDY0050 on
2008-12-31, or should it always fail?
Received on Thursday, 1 May 2008 08:16:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:23 UTC