Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - distinct output [Thread Next] Re: distinct outputTo: NULL Date: 2/7/2008 1:17:00 PM
Index items and then take only first one:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:key name="item" match="item" use="subitem/@name"/>
<xsl:template match="/">
<out>
<xsl:value-of select="key('item', 'aaa')[1]/@name"/>
</out>
</xsl:template>
</xsl:stylesheet>
--
Oleg
bbembi_de@l... wrote:
> Hello,
>
> I have a xml like this:
>
> <root>
> <item name="111">
> <subitem name="aaa">
> <subitem name="bbb">
> </item>....
>
> Now I want to output the item names for some subitems.
> example: I want all item names with a subitem "aaa"
>
> I can do that. Now comes the but:
> I want them only be outputted once.
>
> How can I do that?
>
> bye bembi
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
