[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Grouping problem

Subject: Re: Grouping problem
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Mon, 01 Aug 2005 10:35:44 +0200
stumble grouping
Hi Mukul,

Bizare, isn't it, how you can solve hundreds of problems instantaneously and then stumble apon a simple situation that behaves completely unexpectedly;)

Tempore 08:56:50, die 08/01/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Mukul Gandhi <gandhi.mukul@xxxxxxxxx>:

I am trying to do grouping operation with the following XSL -
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	
	<xsl:template match="/root">
	   <groups>
  	     <xsl:for-each select="*[not(name() = name(preceding-sibling::*))]">
            <group name="{name()}" />
   	     </xsl:for-each>
	   </groups>
	</xsl:template>
	
</xsl:stylesheet>

The 'name()' function takes only the first node when it's argument is a node-set.


regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Deserta faciunt et innovationem appelant

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.