Arrays in the built-in template rules

ACTION 2015-09-10-002: MK to make a proposal on how to handle arrays
in the template-match rules (as outlined in
https://lists.w3.org/Archives/Member/w3c-xsl-wg/2015Sep/0007.html <https://lists.w3.org/Archives/Member/w3c-xsl-wg/2015Sep/0007.html> part
(B) and discussed on 10 September [arrays as functions, or atomized?])

On reflection, instead of handling arrays identically to functions in the built-in template rules, I feel the following causes fewer surprises:

Text-only-copy

Apply templates to the members of the array:

<xsl:template match=“.[. instance of array(*)]" mode="M">
  <xsl:apply-templates mode="#current” select=“?*"/>
</xsl:template>

Deep-copy

Same as for nodes, atomic values, functions, etc.

Shallow-copy

On balance, I recommend doing the same as for functions and maps, though this one is debatable.

Deep-skip

Same as for functions and maps.

Shallow skip

As for text-only-copy: apply templates to the members of the array.

Fail

Like everything else, raise an error.

Michael Kay
Saxonica

Received on Saturday, 12 September 2015 17:06:25 UTC