If you want an XSLT 3.0 solution rather than an XPath solution then you could
do
<xsl:map>
<xsl:for-each select="$strings">
<xsl:map-entry key="." select="position()"/>
</xsl:for-each>
</xsl:map>
Michael Kay
Saxonica
> On 12 Jan 2026, at 20:53, Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>
> On 12/01/2026 21:48, Christophe Marchand christophe@xxxxxxxxxxxx wrote:
>> I have a sequence of xs:string : ('amount', 'vat-rate', 'total')
>> And I want a map where keys are the labels from the sequence, and values
are the position of label in sequence : { 'amount': 1, 'vat-rate': 2, 'total':
3}
>
>
> One way would be
>
> (('amount', 'vat-rate', 'total') ! map:entry(., position())) => map:merge()
| Current Thread |
|
Michael Kay michaelkay90@xxxxxxxxx - 12 Jan 2026 22:50:27 -0000 <=
Message not available
Marc marc.liste@xxxxxxx - 12 Jan 2026 20:53:51 -0000
|
|