2013-12-04T01:28:38.942159+01:001.0http://jsound.io/modules/validate/mapmap Map utility
Chris Hillery, Cezar Andreijsoniq1.0utf-8 Inserts new key and value into the map or replaces value under the exiting key.
Returns true all the time.
$map the map JSON object$key the key$value the valuetrue Example:map:setdeclare %an:sequential function map:set($map as object(), $key as xs:string, $value as item()) as booleanmapobject()keyxs:stringvalueitem()booleanhttp://www.w3.org/2005/xpath-functionskeys Only if key doesn't exist, inserts new key and value into the map and
returns true. Otherwise returns false.
$map the map JSON object$key the key$value the valuetrue if $key is empty, false otherwise Example:map:set-if-emptydeclare %an:sequential function map:set-if-empty($map as object(), $key as xs:string, $value as item()) as booleanmapobject()keyxs:stringvalueitem()booleanhttp://www.w3.org/2005/xpath-functionskeys Returns the value under the key.
$map the map JSON object$key the keythe value under the $key, () if empty Example:map:getdeclare function map:get($map as object(), $key as string) as item()mapobject()keystringitem() Returns true if $key exists in the map.
$map the map JSON object$key the keytrue if $key exists, false otherwise Example:map:has-keydeclare function map:has-key($map as object(), $key as string) as booleanmapobject()keystringbooleanhttp://www.w3.org/2005/xpath-functionskeys