Creating arrays
The new xsl:array instruction can be used to create an array. The contents of the array are formed from the sequence returned by the contained sequence constructor.
There are two forms of the instruction.
-
To create a simple array in which every member is a singleton item, use
<xsl:array composite="no">
(this is the default so the attribute can be omitted). Every item delivered by the sequence constructor then becomes an individual member of the array. -
To create an array in which some members might be non-singleton sequences, use
<xsl:array composite="yes">
. In this case every item delivered by the sequence constructor must be a parcel. A parcel is an item of typerecord(value, *)
, that is, a map containing an entry whose key is the string "value", and whose corresponding value is an arbitrary sequence. This sequence is used as the value of the array member.It's often convenient to construct a parcel using the xsl:array-member instruction, but that's not the only way to do it. You could also do it, for example, by calling
fn:parcel()
. Or you could decompose an existing array into parcels using the functionarray:members
, and use some of those parcels to form the new array.