This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: AW: adressing attributes
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: AW: [xsl] adressing attributes
- From: Oliver Becker <obecker at informatik dot hu-berlin dot de>
- Date: Fri, 29 Jun 2001 13:47:43 +0200 (MET DST)
- Reply-To: xsl-list at lists dot mulberrytech dot com
> ok, I found it myself...
>
> <xsl:choose>
> <xsl:when test="../element[$here+$half]">
> <xsl:for-each select="../element[$here+$half]">
> <xsl:value-of select="@id"/>
> </xsl:for-each>
> </xsl:when>
> <xsl:otherwise></xsl:otherwise>
> </xsl:choose>
Why not discard xsl:choose and xsl:for-each?
simply write
<xsl:value-of select="../element[$here+$half]/@id" />
If there is no ../element[$here+$half] (your test) then nothing will
be output (the select expression is just an empty node set in this case).
Cheers,
Oliver
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@informatik.hu-berlin.de |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list