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: avoiding repeated items


Tim Watts wrote:
> <xsl:for-each select="poetas/autor">
> 	<xsl:choose>
> 		<xsl:when test="not(.=preceding::autor)">
> 			<xsl:value-of select="."/>
> 		</xsl:when>
> 	</xsl:choose>
> </xsl:for-each>

Yep, or more succinctly, and with line breaks:

<xsl:for-each select="/poetas/autor[not(.=preceding::autor)]">
  <xsl:value-of select="."/>
<xsl:text>
</xsl:text>
</xsl:for-each>

Evan

 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]