Re: [xsl] How to set an element as the context without using a for-each loop?

Subject: Re: [xsl] How to set an element as the context without using a for-each loop?
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 1 May 2024 18:26:42 -0000
On 01/05/2024 20:22, Leo Studer leo.studer@xxxxxxxxxxx wrote:
> Martin,
>
>> On 1 May 2024, at 14:09, Martin Honnen martin.honnen@xxxxxx
>> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>>
>> On 01/05/2024 13:28, Roger L Costello costello@xxxxxxxxx wrote:
>>> Hi Folks,
>>>
>>> I have a function that I pass "record" to:
>>>
>>>
> ...
>>> Is there a better way? One that doesn't involve qualifying every child
element and doesn't involve looping over a single element?
>>>
>> B  <xsl:sequence select="$record ! (Customer_or_Area_Code, Cycle_Date,
>> Sequence_Number) ! f:convert(.)b/>
>>
> I guess this works also with / since it is a node sequence ?
>
> B <xsl:sequence select="$record / (Customer_or_Area_Code, Cycle_Date,
> Sequence_Number) / f:convert(.)"/>
>

Roger had a certain sequence of e.g.

 B B B B B B  <xsl:sequence
select="f:convert($record/Customer_or_Area_Code)"/>
 B B B B B B  <xsl:sequence select="f:convert($record/Cycle_Date)"/>
 B B B B B B  <xsl:sequence select="f:convert($record/Sequence_Number)"/>


my suggestion with

<xsl:sequence select="$record ! (Customer_or_Area_Code, Cycle_Date,
Sequence_Number) ! f:convert(.)b/>

will produce the same result (order) while any use of / will sort the
elements in document order.

Current Thread