Re: [xsl] Sequence count vs. context position

Subject: Re: [xsl] Sequence count vs. context position
From: "Michael Kay michaelkay90@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 4 Oct 2024 08:26:00 -0000
How about key('keyNameb, $keyValue)[not(preceding-sibling::*)]

Michael Kay
Saxonica

> On 4 Oct 2024, at 08:52, Michael Mueller-Hillebrand
michael.mueller-hillebrand@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
wrote:
>
> Dear colleagues,
>
> I am somewhat puzzled by this situation:
>
> key('keyNameb, $keyValue)[1]
>
> From an example in Michael Kaybs XSLT 2.0 bible and the description of
position(), I learn that this form selects the first item in the sequence of
nodes returned by key().
>
> How would I have to write the expression, if I wanted to filter only those
nodes, which are at position 1 in their respective document context? I know I
can have predicates which consider the context of all returned nodes, looking
at ancestors etc. But somehow position() seems to be special.
>
> Thanks a lot,
> Michael
>
> Michael MC<ller-Hillebrand
> Senior Consultant
> Phone +49 951-20859-752
> Mobil +49 172-819 34 13
> michael.mueller-hillebrand@xxxxxxxxx
<mailto:michael.mueller-hillebrand@xxxxxxxxx>
> www.docufy.de <https://www.docufy.de/> | DOCUFY@LinkedIN
<https://www.linkedin.com/company/3845358/>
> Datenschutz <https://www.docufy.de/datenschutz/>
> DOCUFY GmbH | KirschC$ckerstr. 27 | 96052 Bamberg | Deutschland
> GeschC$ftsfC<hrung: Nadine Prill (CEO) & Falko Schmidt (CFO) | Amtsgericht
Bamberg HRB10571
>
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3500899> (by
email <>)

Current Thread