W3C home > Mailing lists > Public > public-xslt-40@w3.org > January 2021

Re: Processiing arrays in XSLT 4

From: Michael Kay <mike@saxonica.com>
Date: Sat, 9 Jan 2021 17:39:09 +0000
Cc: public-xslt-40@w3.org
Message-Id: <3674FA1A-AFE4-4ACC-9338-2D783DC83AFE@saxonica.com>
To: Dimitre Novatchev <dnovatchev@gmail.com>
> Why not just:
> <xsl:array select ="{expressionProducingAnArray}"/>  

Constructing an array when you need to invoke xsl:apply-templates as part of the array construction is very inconvenient at present, and that's a common requirement when transforming XML to JSON.

Also, there's no easy way in XPath of constructing a completely general array: the [...] constructor only works if the size of the array is known statically, and the array{...} constructor only works if each member of the array is a singleton.

Michael Kay
Received on Saturday, 9 January 2021 17:39:24 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 January 2021 17:39:25 UTC