XPath/XQuery size function

Summary

Returns the number of entries in the supplied map.

Signature

map:size(
$map as map(*)
) as xs:integer

Properties

This function is deterministic, context-independent, and focus-independent.

Rules

The function map:size takes any map as its $map argument and returns the number of entries that are present in the map.

Examples

The expression map:size(map{}) returns 0.

The expression map:size(map{"true":1, "false":0}) returns 2.