|
Subject: Re: [xsl] How to set an element as the context without using a for-each loop? From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 1 May 2024 12:07:12 -0000 |
On Wed, May 01, 2024 at 11:49:59AM -0000, Pieter Masereeuw pieter@xxxxxxxxxxxx scripsit:
[snip]
> Currently, I use to add a comment to my <xsl:for-each> that explains that it
> will iterate only once.
If I understand the language design intent correctly, part of the point
is that "for-each" doesn't iterate; it's "make the members of this
sequence the context item for this sequence constructor".
Like value-of, it could have had a better name, but it's not
conceptually a loop.
> On 5/1/24 13:31, David Carlisle d.p.carlisle@xxxxxxxxx wrote:
> <xsl:sequence select="$record/(f:convert(Customer_or_Area_Code),f:convert
> (Cycle_Date),f:convert(Sequence_Number))"/>
Or even
<xsl:variable name="recordMap" as="map(*)" select="
"Customer_or_Area_Code": f:convert#1,
"Cycle_Date": f:convert#1,
"Sequence_Number": f:convert#1
"/>
<xsl:sequence select="$record/* ! recordMap(name())(.)"/>
Overkill for this situation, but useful if different child elements need
to be fed through different functions.
-- Graydon
--
Graydon Saunders | graydonish@xxxxxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor ("That passed, so may this.")
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] How to set an element as , Pieter Masereeuw pie | Thread | Re: [xsl] How to set an element as , Martin Honnen martin |
| Re: [xsl] How to set an element as , Pieter Masereeuw pie | Date | Re: [xsl] How to set an element as , Martin Honnen martin |
| Month |