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]

Re: AW: adressing attributes



> 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


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