Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Grouping problem

From: "Joris Gillis" <roac@---------->
To:
Date: 8/1/2005 8:35:00 AM
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


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