This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: select following-siblings, but not all of them
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] select following-siblings, but not all of them
- From: Kay Michael <Michael dot Kay at icl dot com>
- Date: Tue, 19 Dec 2000 14:46:59 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
when I have something like
<name>Tom</name>
<remark>1</remark>
<remark>2</remark>
<remark>3</remark>
<name>John</name>
<remark>4</remark>
<remark>5</remark>
<remark>6</remark>
is there a way of creating something like
Tom: 1,2,3
John: 4,5,6 ?
This is an example of a positional grouping problem.
One solution is:
<xsl:for-each select="name">
<tr><td><xsl:value-of select="."/></td>
<td>
<xsl:for-each select="following-sibling::remark[
count(previous-sibling::name[1] | current()) = 1]">
<xsl:value-of select="remark"/>,
</xsl:for-each>
</td>
</tr>
</xsl:for-each>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list