Re: Variables and inherited attributes

Subject: Re: Variables and inherited attributes
From: T_MULLEN 58211 6th Singer St <Tom.Mullen@xxxxxxxxxxx>
Date: Fri, 23 Jun 2000 11:01:44 +0000 (GMT)
I'm new at this so apologies if this is naive but from my recent reading of
the XSLT spec I remembered this:

(excerpt from last paras of 7.6.1)

"The following precedes each procedure element with a paragraph containing
the security level of the procedure. It assumes that the security level
that applies to a procedure is determined by a security attribute on the
procedure element or on an ancestor element of the procedure. It also
assumes that if more than one such element has a security attribute then
the security level is determined by the element that is closest to the

<xsl:template match="procedure">
    <xsl:value-of select="ancestor-or-self::*[@security][1]/@security"/>


>> the currently active value for xml:lang is
>> <xsl:value-of select="ancestor-or-self::*/@xml:lang[1]"/>
>Not quite; that select expression returns the set of xml:lang values on
>ancestor nodes (the [1] does nothing, as an element can't have two
>attributes), and the xsl:value-of then selects the string value of the
>one in document order, which is the outermost.
>Correct is:
><xsl:value-of select="(ancestor-or-self::*/@xml:lang)[last()]"/>
>or (perhaps marginally faster)
><xsl:value-of select="ancestor-or-self::*[@xml:lang][1]/@xml:lang"/>
>Mike Kay
> XSL-List info and archive:

        Visit our Internet site at

Any views expressed in this message are those of  the  individual
sender,  except  where  the sender specifically states them to be
the views of Reuters Ltd.

 XSL-List info and archive:

Current Thread