Re: [xsl] Finding the right entry in a sequence that matches...

Subject: Re: [xsl] Finding the right entry in a sequence that matches...
From: "Christophe Marchand cmarchand@xxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Nov 2025 06:31:54 -0000
Stainless !

|exists( filter( $words, function($s) { starts-with($sentence, $s) } ) ) |

Christophe

Le 20/11/2025 \xE0 07:20, Christophe Marchand cmarchand@xxxxxxxxxxxxxx a 
\xE9crit :

> Hello !
>
> a long time without XML work, IC"BBm a little bit rusty and need help !
>
> I have a sequence that contains words, and another that contains a 
> sentence. I want to know if there one word that starts the sentenceC"BB&
>
> In Java, that would be :
>
> |List&lt;String&gt; words = ... ; String sentence = ... ; return 
> words.stream().anyMatch(w -&gt; sentence.startsWith(w)); |
>
> But with XPath / xslt C"BB& ?
>
> |&lt;xsl:variable name=&quot;words&quot; as=&quot;xs:string&quot; 
> select=&quot;...&quot;/&gt; &lt;xsl:variable name=&quot;snetence&quot; 
> as=&quot;xs:string&quot; select=&quot;...&quot;/&gt; &lt;xsl:sequence 
> select=&quot;... ? ...&quot; /&gt; |
>
> Thanks in advance,
> Christophe
>
> &#8203;
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3515434> 
> (by email <>)
&#8203;

Current Thread