This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: 2 unique lists
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: 2 unique lists
- From: "Spychalski, Frank" <frank dot spychalski at sap dot com>
- Date: Mon, 7 Aug 2000 19:10:43 +0200
- Reply-To: xsl-list at mulberrytech dot com
->-----Original Message-----
->From: Matthew Cordes [mailto:mcorde61@maine.edu]
->Subject: 2 unique lists
Hi,
-><xsl:template match="person">
-> <xsl:value-of select="@name"/><xsl:text>: </xsl:text>
-> <xsl:for-each select="date[ not( . = preceding::date )]">
-> <xsl:value-of select="."/>
-> <xsl:if test="not(position()=last())">, </xsl:if>
-> </xsl:for-each>
-></xsl:template>
->
->which produces:
-> person1: feb2000, mar2000, Apr2000
-> person2:
The problem is you use preceding which for person2 matches person1 and its
children and therefor nothing is 'printed' for person2. Use
preceding-sibling instead and it should work. (BTW: I never understood all
the axis till I saw the diagrams in Michal Kay's Book...)
bye
Frank
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list