Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 3rd, 2006, 05:35 PM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default checking first sibling

Hi there,

I have
<xsl:if test="...">
  something
</xsl:if>

and I need the test expression to return true, if (and only if) the first sibling of the current element is element <reset>. For example, if I have

<a/>
<b/>
<reset/>
<c/>
<d>
 <e>
  <f/>
 </e>
</d>
<reset/>
<x/>
<y/>

the expression should return true at <b/> and <d>. What is the correct expression for that?

Thanks for any help...
Stavinoha

 
Old July 3rd, 2006, 06:02 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

test="following-sibling::*[1][self::reset]"

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old July 4th, 2006, 02:13 AM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's exactly it, thanks for the quick reply!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Using preceding-sibling mcanne98 Infopath 0 September 11th, 2008 11:09 PM
following-sibling. hanzelko XSLT 1 February 2nd, 2007 04:11 PM
following-sibling assistance needed djmarquette XSLT 3 March 9th, 2006 02:54 PM
preceding-sibling jonesyp XSLT 2 November 22nd, 2005 12:29 PM
MDI Sibling calling Sibling... Nick.Net VB.NET 2002/2003 Basics 1 December 8th, 2003 09:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.