[Bug 29080] array:members

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29080

--- Comment #9 from Josh Spiegel <josh.spiegel@oracle.com> ---
Consider this query:

  declare variable $games := parse-json('[
     { "location" : "Webster", "scores" : [8, 10] },
     { "location" : "Kirkwood", "scores" : [5,7] },
     { "location" : "Webster", "scores" : [7,3] }
  ]');

  declare function local:getAverages($location) {
     $games?*[?location eq $location]?scores ! avg(.)
  };

  <result>
     <webster>{local:getAverages('Webster')}</webster>
     <kirkwood>{local:getAverages('Kirkwood')}</kirkwood>
  </result>

Currently this evaluates to:

  <result><webster>9 5</webster><kirkwood>6</kirkwood></result>

But under your proposal, it would return:

  <result><webster>9 5</webster><kirkwood>5 7</kirkwood></result>

Correct?

If so, I think a user would find this surprising.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Monday, 13 June 2016 23:51:58 UTC