W3C home > Mailing lists > Public > public-xsl-query@w3.org > July 2016

map:find() - initial sketch proposal

From: Michael Kay <mike@saxonica.com>
Date: Tue, 26 Jul 2016 17:48:40 +0100
Message-Id: <99CEB57A-9ACB-42DB-B841-910B58939271@saxonica.com>
To: Public Joint XSLT XQuery XPath <public-xsl-query@w3.org>
Here's an first stab at a proposal for a map:find() function in response to bug 29743.

     map:find($x as item()*, $key as xs:anyAtomicType) as array(*)

This function returns an array containing all values that are associated with the key $key in any map that is *contained in* the value of $x

A map or array M is *contained in* a sequence S if any of the following conditions holds:

* M is an item in the sequence S (including the case where S is the single item M)

* M is *contained in* the value part of a key-value pair within a map that is itself *contained in* S

* M is *contained in* a member of an array that is itself *contained in* S

The order of members in the result array is implementation-dependent.

If nothing is found (including the case where $x is an empty sequence), the function returns an empty array.

Michael Kay
Received on Tuesday, 26 July 2016 16:49:16 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:43:19 UTC