map:keys

Returns a sequence containing all the keys present in a map, in entry order.

keys($map as map(*)) ➔ xs:anyAtomicType*

Arguments

 

$map

map(*)

The map whose keys are required

Result

xs:anyAtomicType*

Namespace

http://www.w3.org/2005/xpath-functions/map

Links to W3C specifications

XPath 3.1 Functions and Operators

XPath 4.0 Functions and Operators

XSLT 3.0 Specification

Saxon availability

Available in XPath 3.1, XSLT 3.0, XQuery 3.1, and later versions. From Saxon 9.7, available in all editions. Available for all platforms.

Notes on the Saxon implementation

Available as defined in XSLT 3.0 since Saxon 9.4; in XSLT, XPath, and XQuery, whether or not 3.0 is available.

XPath 3.1 version implemented since Saxon 9.7.

From XPath 4.0, the entries in a map are ordered (previously order was not significant). Since Saxon 13.0, map order is preserved whether or not XPath 4.0 features are enabled, so this function always now returns the results in entry order.