[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Using node-set variables in predicates (another no

Subject: Re: Using node-set variables in predicates (another node comparison question)
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 1 Jan 2022 09:20:13 -0000
Re:  Using node-set variables in predicates (another no
Am 01.01.2022 um 07:00 schrieb Chris Papademetrious
christopher.papademetrious@xxxxxxxxxxxx:
>
> Hi everyone, and happy new year's!
>
> Let's say I have a variable that contains a set of nodes:
>
> <xsl:variable name="nodes" select="//(foo|bar|baz)"/>
>
> In XPath 3.0, I can apply a template directly to this node-set
> variable (very cool!):
>
> <xsl:template match="$nodes">
>
> However, what's the best way to use this node-set variable as a
> predicate filter? For example, let's say I wanted to select every
> preceding sibling node directly before each node in the variable:
>
> <xsl:template match="preceding-sibling::node()[1][. intersect $nodes]">
>
> The "interesect" operator works, but it's not intuitive. Is there a
> simple Boolean operator that indicates whether a given node exists in
> a set of nodes?
>
Or you can use

 B B  [generate-id() = $nodes!generate-id()]

as the predicate.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.