Using xsl:for-each-group element, sequences can be grouped by the specified criterion. The select attribute on xsl:for-each-group specifies sequences to be grouped, the second attribute on this element determines the type of grouping.
In this example nodes are grouped by the value of "v" attribute. For this kind of grouping attribute group-by is used.
Inside xsl:for-each-group select attribute of xsl:apply-template which is set to "." selects the first node of the group.
Function current-group() is used if all nodes from the group are needed. Function current-grouping-key() gives the grouping value which is currently used.
|
XSLT
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/> <xsl:template match="/aaa"> <xsl:for-each-group select="*" group-by="@v"> <sss> <xsl:apply-templates select="."/> </sss> <ggg id="{current-grouping-key()}"> <xsl:apply-templates select="current-group()"/> </ggg> </xsl:for-each-group> </xsl:template> <xsl:template match="*"> <xsl:copy-of select="."/> </xsl:template> </xsl:stylesheet> |
|
|
XML
<aaa> <bbb v="a2"/> <ccc v="1"/> <ddd v="1"/> <eee v="a2"/> <fff v="1"/> <ggg v="zz3"/> </aaa> |
Output
<sss> <bbb v="a2"/> </sss> <ggg id="a2"> <bbb v="a2"/> <eee v="a2"/> </ggg> <sss> <ccc v="1"/> </sss> <ggg id="1"> <ccc v="1"/> <ddd v="1"/> <fff v="1"/> </ggg> <sss> <ggg v="zz3"/> </sss> <ggg id="zz3"> <ggg v="zz3"/> </ggg> |
| Previous chapter: | Elements and attributes |
| Next chapter: | Multiple source documents |
| Previous page: | - - - |
| Next page: | Grouping with group-adjacent |
Quiksilver Board Shorts
Roxy Board Shorts
Volcom Board Shorts
Billabong Board Shorts
Quicksilver Board Shorts
Hurley Board Shorts
Quicksilveredition Board Shorts
Rusty Board Shorts
Reef Board Shorts
oneill Board Shorts
Ezekiel surf clothing Board Shorts
Paul Frank surf clothing Board Shorts
Mada surf clothing Board Shorts
Analog surf clothing Board Shorts
Quicksilver surf clothing Board Shorts
Jet Pilot surf clothing Board Shorts
Quicksilveredition surf clothing Board Shorts
Dakine surf clothing Board Shorts
Matix surf clothing Board Shorts
Reef surf clothing Board Shorts
O'neil surf clothing Board Shorts
Also, you will want to check out Stanton California so you can see what's up and they are part of Stanton City Hall as well.
You can also get Organic Skin Care products from Bliss Bath Body and you must check out their Natural Body Lotions and bath soaps
Now if you are looking for the best deals on surf clothing from Quiksilver and Roxy then you have to check these amazing deals here: quiksilver tees http://www.killerdana.com/killerdana/search2.asp?SearchResults.SearchHandle=QT1NZW5zIFNTIFRlZXN_Qj1NZW5zIFNTIFRlZXN_RD01OX5FPTBeMV4yXm51bV9uZXd_ST1QcmljZX5LPTR_TD0xfk09NH5OPTN_&SearchResults.SortAscending=False&SearchResults.SortBy=num_new&Answer=766
quiksilver shirt Quiksilver Shirt
quiksilver board short quiksilver board short
quiksilver clothing Quiksilver clothing
quiksilver apparel Quiksilver apparel
quiksilver jackets quiksilver jacket
quiksilver jeans Quiksilver Shirt
quiksilver shoes Quiksilver Shoes
quiksilver sweaters Quiksilver Sweaters
quiksilver tank Quiksilver Tanks
quiksilver tees Quiksilver Tops
quiksilver wetsuits Quiksilver Wetsuits
Hey, check out this Organic Skin Care European Soaps along with Natural Lavender Body Lotion and shea butter
This is the guy we need in government office. His name is Kevin Carr City Of Stanton Council Candidate and he is a great guy. and we can get surf t shirts surfing shirt and Swim Shop for swim wear wimming gear women's and men's This is the guy we need in government office. His name is Kevin Carr City Of Stanton Council Candidate and he is a great guy. and we can get surf t shirts surfing shirt and Swim Shop for swim wear wimming gear women's and men's