xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Counting proceding elements with the attribute value


Subject: Re: [xsl] Counting proceding elements with the attribute value
From: "Niklas Gustavsson" <niklas@xxxxxxxxxxxxx>
Date: Mon, 8 Apr 2002 01:14:07 +0200

ahh, current() did all the magic! Thanks a lot!

/niklas

----- Original Message ----- 
From: <Joerg.Heinicke@xxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, April 08, 2002 1:01 AM
Subject: Re: [xsl] Counting proceding elements with the attribute value


> > Then I have this XSLT fragment:
> > <xsl:template match="node">
> >  <xsl:value-of select="@name" />
> >  <xsl:if test="following-sibling::attr/@name = @name or
> > preceding-sibling::attr/@name = @name">
> >   <!-- here I want to output the number of proceding elements with the
> > same
> > value in the name attribute -->
> >  </xsl:if>
> > </xsl:template>
> 
> I think the best is
> 
> <xsl:value-of select="count(../node[@name = current()/@name])"/>
> 
> Joerg
> 
> -- 
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor