xsl-list
[Top] [All Lists]

Re: [xsl] XSL counting node by inheritable attribute

2010-11-18 23:00:18
Hi,

2010/11/17 Michael Kay <mike(_at_)saxonica(_dot_)com>:
You can use (ancestor-or-self::*/@type)[last()] to access the innermost
attribute named @type on this element or a containing element.

Thanks! In my case this turned out to

<xsl:value-of 
select="count(//level1[(_at_)feature=$current_feature]/level2/level3[(ancestor-or-self::*/@type)[last()])=$current_type])"/>

where $current_feature and $current_type are the variables from the
loops mentioned earlier. I had some trouble putting the query given by
you together with comparison of the value although now that I did it,
it seems very obvious. Live and learn.

BR,
Paavali

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>