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

Re: how to set the pattern to get the node

Subject: Re: how to set the pattern to get the node
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Tue, 30 Nov 2004 06:32:09 +0100
Re:  how to set the pattern to get the node
Hi Que Li,

How I can get the node which parent_ID =1 or parent_ID
is not 1 but No other sibling node List_ID equal to
current node parent_ID

I try to use:
   <xsl:template match="List[Parent_ID=1 or
not(../List[List_ID = current()/Parent_ID])] ">

The value of current() changes during the evaluation of a Path in an XPath expression. It is not pointing to the List element for which the math pattern is being tested.

Besides, you might want to rule out the List element under consideration from the test on the siblings..

You could try the following:

<xsl:template match="List">
  <xsl:variable name="self" select="."/> <!-- current() can be shortened to . -->
    <xsl:when test="Parent_ID = 1">
      <!-- found a valid case -->
    <xsl:when test="not(preceding-sibling::List[List_ID = $self/@Parent_ID]
                        or following-sibling::List[List_ID = $self/@Parent_ID])">
      <!-- found second valid case -->
    <!-- xsl:otherwise? -->


Current Thread


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.
First Name
Last Name
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.