Re: Using the key function
<xsl:key name="numkey" match="//house" use="member/@ref"/> OK, although as I say, // never means anything at the start of a match. <xsl:for-each-group select="//project" OK but do you really want to select projects or houses? group-by="property[@name='number']/@val" the group-by expression will be evaluated from the selected project node which doesn't have a property child, so this will always evaluate to empty so everything is in one group. You haven't given any indication of what output you want so I don't know if you want to group houses (by changing the select to //property/house) in which case this group-by expression would do something more interesting, or if you want to group projects which would be something like group-by="house/property[@name='number']/@val" except that that will return multiple values for each project, which you probably don't want. <xsl:sort select="@number"/> This will do nothing on the posted example as project elements don't have number attributes, but perhaps your real input does. select="key('numkey',@id) @id selects the id attribute of the current node (which is a project node) which doesn't have any attributes in your posted input David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format