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:50:04 -0000
On 02/07/2024 13:42, Jean-Paul Rehr rehrjb@xxxxxxxxx wrote:

>That sounds as ifB 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).

It's eXist-db's XSLT transformation function, that hands off to Saxon.
The fragment is detached from the node when passed into the function.


Seems you have found a way but perhaps


B <xsl:template match="(/div//head)[1]">

works if the div from XQuery is passed in as the root element to Saxon
by exist-db's transform:transform

Current Thread