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

Conditional & Preceding-sibling

Subject: Conditional & Preceding-sibling
From: Lee Goddard <home@xxxxxxxxxxxxxx>
Date: Fri, 18 Aug 2000 10:40:57 +0100
conditional preceding sibling
I wish to only output a value
if a certain attribute of an element
is not the same as the same attribute of
the preceding element at the same level.

So,

  <EQUATION node="one" othero="x">
   <ATOM v="12"><ATOM y="22"/>
  </EQUATION>
  <OTHERTAGS/>
  <EQUATION node="two" othero="y">
   <ATOM v="23"><ATOM y="33"/>
  </EQUATION>

Would only print both equations if
both node values were the same.

Some time ago Ken Holman and Mike Kay
combined to show me the below. Only
six weeks later, having finished other
parts of my project and running large
test do I find that it only seems to
work on the first nodes of a file.

This could be because I'm not really
clear on the preceding-sibling::*[@node][1]/@node
line.... but then printing the preceding-.... 
bit before the xsl:choose block shows
the correct value -- is it my conditional?

<xsl:choose>
  <xsl:when test="not(@node = preceding-sibling::*[@node][1]/@node )">
    <xsl:value-of select="@node"/>:
  </xsl:when>
  <xsl:otherwise>    ;  </xsl:otherwise>
</xsl:choose>

Many thanks in advance,
Lee Goddard

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


 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.