Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: xslt: continue in for-each-group? >Thread Next - Re: xslt: continue in for-each-group? Re: xslt: continue in for-each-group?To: NULL Date: 2/7/2008 5:13:00 PM bbembi_de@l... wrote: > Thanks very much for the info. > > Now I found out what my real problem is (I tried xsl:choose before > writing the first mail): > > I have a xml like this: > > <root> > <item name="111"> > <subitem name="aaa"> > <subitem name="bbb"> > </item>.... > > I group the subitems but only want to output a item name once. > I want only one item output. > > <xsl:for-each-group select="subitem" group-by="name"> > <xsl:apply-templates select="current-group()" //here I output > the name of the parent (item) but this should be only once for every > item. I am not sure I understand what you want to achieve, your sample has just one item element having two subitem children with an attribute named 'name' which has different values so there is not much to group by. And your XPath does group-by="name", if you want to group on the attribute you need group-by="@name". Can you show us enough XML sample data that it becomes clear what you want to group? -- Martin Honnen http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
