Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - Re: [xsl] XPatch: ancestor and count [Thread Next] RE: [xsl] XPatch: ancestor and countTo: Date: 10/1/2004 12:56:00 PM > > <xsl:for-each select="child::menuitem"> > > <tr><td><xsl:value-of select="count(.//ancestor::*)"/></td><td> > > <xsl:value-of select="@title"/></td></tr> > > </xsl:for-each> > > > > > In this context, './/' means 'descendant-or-self::*', right? Well spotted, I missed that. .//ancestor::* means ./descendant-or-self::node()/ancestor::* so you are counting how many distinct ancestors you and all your descendants have. This is one for you, one for each of your ancestors, and one for each of your descendants that has at least one child. Michael Kay http://www.saxonica.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
