Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - using xslt axes >Thread Next - Re: using xslt axes Re: using xslt axesTo: NULL Date: 5/28/2009 2:39:00 PM Manish wrote:
> Can anyone tell if this is the expected behaviour of 'preceding' axes.
Yes.
> And how to get the expected output. (using xslt 1.0)
Use preceding-sibling instead of preceding, then you will get what you want:
<xsl:template match="main" xml:space="preserve">
<xsl:for-each select="root/test">
<xsl:for-each select=" *[not(preceding-sibling::*/@key = @key) ]">
//<xsl:value-of select="@key"/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
--
Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
