This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: last() or preceding node if last() have empty text-node selection
- From: "Andrew Welch" <awelch at piper-group dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Fri, 24 May 2002 11:32:28 +0100
- Subject: RE: [xsl] last() or preceding node if last() have empty text-node selection
- Reply-to: xsl-list at lists dot mulberrytech dot com
<xsl:if test="//DARBEDINGUNG[last()]/DARBEDINGUNG.laufzeitbis != '' ">
<xsl:value-of
select="//DARBEDINGUNG[last()]/DARBEDINGUNG.laufzeitbis"/>
</xsl:if>
I would change your xsl:if to an xsl:choose, like this:
<xsl:choose>
<xsl:when test="//DARBEDINGUNG[last()]/DARBEDINGUNG.laufzeitbis != ''
">
<xsl:value-of
select="//DARBEDINGUNG[last()]/DARBEDINGUNG.laufzeitbis"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of
select="//DARBEDINGUNG[last()-1]/DARBEDINGUNG.laufzeitbis"/>
</xsl:otherwise>
</xsl:choose>
cheers
andrew
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.350 / Virus Database: 196 - Release Date: 17/04/2002
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list