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/10/2008 11:12:00 PM Hello again,
given the following xml:
<root>
<item name="111">
<subitem name="aaa">
<subitem name="bbb">
<subitem name="ccc">
</item>
<item name="222">
<subitem name="ccc">
<subitem name="bbb">
</item>
If i want all item names that have the subitems aaa and ccc I want the
output:
111
but currently I get the output:
111
111
How can I do this?
thanks bembi
On 7 Feb., 17:12, Martin Honnen <mahotr...@yahoo.de> wrote:
> bbembi...@lycos.de wrote:
> > Thanks very much for the info.
>
> > Now I found out what my real problem is (I triedxsl: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 | |||
|
