This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Question reqarding display the content pending on the number of elements
- From: Oleg Tkachenko <olegt at multiconn dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Wed, 23 Jan 2002 18:49:21 +0200
- Subject: Re: [xsl] Question reqarding display the content pending on the number of elements
- Organization: Multiconn International
- References: <F197NY1SWoBDyseVwrb00023a66@hotmail.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
ªL ¤lªä wrote:
> the question is, how do i insert the comma at the end of each children
> element using xsl stylesheet BUT not adding a comma for the last
> children (e.g. wayne for the smith and Jay)?
Check whether a children is last one.
<xsl:template match="children">
<xsl:value-of select="."/>
<xsl:if test="position()!=last()">, </xsl:if>
</xsl:template>
in addition, is there a way
> to use xsl:if statment that will give a condition that states "if the
> number of element (children in the above example) are more than 1"
Just as you said:
<xsl:if test="count(children) > 1">
--
Oleg Tkachenko
Multiconn International, Israel
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list