Re: [xsl] targeting the 'first' instance of the same element in variable structures

Subject: Re: [xsl] targeting the 'first' instance of the same element in variable structures
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 2 Jul 2024 11:40:57 -0000
On 02/07/2024 13:32, Martin Honnen martin.honnen@xxxxxx wrote:
>
>
> On 02/07/2024 13:28, Jean-Paul Rehr rehrjb@xxxxxxxxx wrote:
>> >Or can the outer div appear at any level/with any nesting and parent
>> container?
>>
>> The fragments I pass to the transformer always start with <div>.
>>
>> But toB explain the larger context:
>>
>> These <div> fragments are all _direct children_ of a single <body>,
>> but for a few reasons I can't pass the full body to the
>> transformation. These fragments are being passed into transformation
>> from Xquery which can be reduced to:
>>
>> for $div in $mydoc//body/div
>> return
>> B  B  B  transform:transform($div, $myxsl, ())
>>
>>
> That sounds as if
>
> B  match="(body/div//head)[1]"
>
> should do as the XSLT processor should still see the parent (or
> perhaps not, what is transform:transform?, BaseX or exist-db, would
> need to check how their XSLT function works exactly).
>

So it sounds like eXist-db
https://exist-db.org/exist/apps/doc/xsl-transform#transform but based on
the documentation I can't tell how the XQuery processor passses the node
to Saxon, let's hope Adam Retter reads here and can tell or of course
anyone else using XSLT with Saxon in the context of eXist-db.

Current Thread