Subject: Conditional & Preceding-sibling From: Lee Goddard <home@xxxxxxxxxxxxxx> Date: Fri, 18 Aug 2000 10:40:57 +0100 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Is there a way to translate ent, Ewout Kanger | Thread | Re: Conditional & Preceding-sibling, Jeni Tennison |
Re: to extract the longest string (, Oliver Becker | Date | Is XSL suitable for batch processin, Loz |
Month |