Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xslt: continue in for-each-group?

From: Martin Honnen <mahotrash@-----.-->
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/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent