xsl:record

New in XSLT 4.0. Used to construct a record map.

Category: instruction
Content: sequence-constructor
Permitted parent elements: any XSLT element whose content model is sequence-constructor; any literal result element

Attributes

xsl:as?

item-type

Defines the required type of the record map.

xsl:duplicates?

expression

An expression which must evaluate to either one of the strings "use-first", "use-last", "use-any", "combine", or "reject", or an arity-2 function. If the attribute is present, then when a duplicate key value is encountered, the function is called supplying the old and new values for the key, and the old value for the key is replaced with the result of the function call. For example, if the function is fn($old, $new){$old, $new} then the new value will be the sequence-concatenation of the duplicate entries.

*

expression

The instruction may have any number of attributes in no namespace. Map entries for the record map can be declared using attributes - the attribute name is used as the map key, and the associated map value is the result of evaluating the XPath expression in the attribute value.

Saxon availability

Available in XSLT 4.0. Requires Saxon-PE or Saxon-EE. Implemented since Saxon 13. Available for all platforms.

Notes on the Saxon implementation

New in XSLT 4.0, and implemented since Saxon 13.0.

Details

The xsl:record instruction constructs a new map. Entries for the map can be declared using attributes on the instruction, as well as using the contained sequence constructor.

Links to W3C specifications

XSLT 4.0 Specification

See also

xsl:map

xsl:map-entry