This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: last() or preceding node if last() have empty text-node selection



<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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]