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

RE: Match nodes with a range of values

Subject: RE: Match nodes with a range of values
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 15 Jul 2004 16:43:19 +0100
xsl match xpath node name
> "Select all nodes where current nodes timebeg falls between 
> the timebeg and timeend of all event 1's".

You can do this in XPath 2 as

//node[every $n in //node[@id=1] satisfies 
        (@timebeg ge $n/@timebeg and @timebeg le $n/@timeend)]

You can't do general joins in XPath 1 (it's not relationally complete). The
nearest you can get is

<xsl:for-each select="//node">
  <xsl:variable name="n" select="."/>
  <xsl:copy-of select="$n[not(//node[@id=1][@timebeg &lt;= $n/@timebeg or 
                                            @timeget &gt;= $n/@timeend)]"/>
</xsl:for-each>

Michael Kay

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.