Oxygen XML Editor
 
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Count of unique attribute names


Subject: [xsl] Count of unique attribute names
From: "Jesper Tverskov" <jesper@xxxxxxxxxxx>
Date: Fri, 3 Nov 2006 13:08:22 +0100

Hi list

My XSLT 2.0 solution below is working. I am just wondering if there is an
easier way that could perhaps bring distinct-values() into play?

<xsl:variable name="uniqueAttributeNames">
	<xsl:for-each-group select="//@*" group-by="local-name()">
		<xsl:sequence select="local-name()"/>
      </xsl:for-each-group>
</xsl:variable>
<xsl:sequence select="string-length(replace(replace($uniqueAttributeNames,
'\c+',  'x'), '\C+', ''))"/>


Best regards,

Jesper Tverskov
http://www.xmltraining.biz


Current Thread
 
© 2002-2008 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy
This website was created & generated with <oXygen/> XML Editor
Keywords