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

Indexing Tree Elements (repost)

Subject: Indexing Tree Elements (repost)
From: Lee Goddard <home@xxxxxxxxxxxxxx>
Date: Thu, 17 Aug 2000 11:56:11 +0100
tree elements
Hi Folks,

I've been using a line suggested below by Ken Holman

<xsl:if test="not(@foo = preceding-sibling::*[@foo][1]/@foo)">

to only reveal certain content if it is there is a difference
between attribute values found in the node immediately preceeding
the current node.  

It seemed to work for a while, but now seems to show the value of
the first node's attribute.  I've got around this by using the
same code but replacing 'preceding' with 'following'.

But has anyone any idea what the problem might be?

Thanks in anticipation,
lee goddard
-- 
Lee Goddard  <l.goddard@sussex>
Research Centre for Cognitive Science, 
University of Sussex, Brighton UK


"G. Ken Holman" wrote:
> 
> At 00/07/07 13:14 +0100, David Carlisle wrote:
> > > is it possible that it may compare its attributes with the attributes
> > > of the previous document-tree node of the same level?
> >
> ><xsl:if test="@foo = preceding-sibling::*/@foo">
> >  'tis the same
> ></xsl:if>
> 
> I'm sorry if this sounds pedantic, but because the second argument is a
> node list, the above expression will be true if *any* of the preceding
> siblings nodes has an attribute named "foo" of the equal value.
> 
> To check the immediately preceding element for an attribute named "foo", I
> would think one would use:
> 
>    <xsl:if test="@foo = preceding-sibling::*[1]/@foo">
> 
> To check the the closest (in proximity) preceding element with an attribute
> named "foo", I would think one would use:
> 
>    <xsl:if test="@foo = preceding-sibling::*[@foo][1]/@foo">
> 
> I hope this helps and is considered constructive.
> 
> ................. Ken


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.