W3C

XQuery and XPath Functions and Operators Map Namespace Document

Table of Contents

1 Introduction
2 XQuery and XPath Map Functions
3 Normative References
4 Non-Normative References


1 Introduction

This document describes the namespace http://www.w3.org/2005/xpath-functions/map defined by the [XPath and XQuery Functions and Operators 3.1] specification (October 2014 version). This namespace is identified by the namespace prefix map:, which is not a predefined prefix. For updated information, please refer to the latest version of the [XPath and XQuery Functions and Operators 3.1] specification.

This document describes the names that are defined in this namespace at the time of publication. The W3C reserves the right to define additional names in this namespace in the future. [XPath and XQuery Functions and Operators 3.1] is the only specification that may amend this namespace.

This document contains a directory of links to related resources, using RDDL (as defined in [Resource Directory Description Language (RDDL)]).

It is GRDDL-enabled (as defined in [Gleaning Resource Descriptions from Dialects of Languages (GRDDL)]), that is to say that a GRDDL-compliant processor can extract useful RDF (as defined in [Resource Description Framework (RDF): Concepts and Abstract Syntax]) representations of the information contained herein.

2 XQuery and XPath Map Functions

This section lists all of the functions defined by the [XPath and XQuery Functions and Operators 3.1] specification to be in the namespace reserved for certain map-related functions. Each function is uniquely identified with a URI of the form: “http://www.w3.org/2005/xpath-functions/map#name” where name is the name of a function, such as “new”: http://www.w3.org/2005/xpath-functions/map#new.

The normative definitions of these functions are in the [XPath and XQuery Functions and Operators 3.1] specification. For convenience, a very brief, non-normative summary of each function is provided. For details, follow the link on the “Summary:” introductory text below each function.

contains

contains(map(*), xs:anyAtomicType) as xs:boolean

Tests whether a supplied map contains an entry for a given key

entry

entry(xs:anyAtomicType, item()*) as map(*)

Returns a map that contains a single entry (a key-value pair).

for-each

for-each(map(*), function(xs:anyAtomicType, item()*)) as item()*

Applies a supplied function to every entry in a map, returning the concatenation of the results.

get

get(map(*), xs:anyAtomicType) as item()*

Returns the value associated with a supplied key in a given map.

keys

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

Returns a sequence containing all the keys present in a map

merge

merge(map(*)*) as map(*)

Returns a map that combines the entries from a number of existing maps.

put

put(map(*), xs:anyAtomicType, item()*) as map(*)

Returns a map containing all the contents of the supplied map, but with an additional entry, which replaces any existing entry for the same key.

remove

remove(map(*), xs:anyAtomicType) as map(*)

Returns a map containing all the entries from a supplied map, except (typically) one.

size

size(map(*)) as xs:integer

Returns the number of entries in the supplied map.

3 Normative References

These documents describe the names that are defined in this namespace at the time of publication. The W3C reserves the right to define additional names in this namespace in the future.

XPath and XQuery Functions and Operators 3.1

4 Non-Normative References

Resource Directory Description Language (RDDL)
Gleaning Resource Descriptions from Dialects of Languages (GRDDL)
Resource Description Framework (RDF): Concepts and Abstract Syntax