Subject: RE: Variables and inherited attributes From: Kay Michael <Michael.Kay@xxxxxxx> Date: Fri, 23 Jun 2000 09:31:28 +0100 |
> 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 all ancestor nodes (the [1] does nothing, as an element can't have two xml:lang attributes), and the xsl:value-of then selects the string value of the first 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: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: Variables and inherited attribu, Kay Michael | Thread | Re: Variables and inherited attribu, T_MULLEN 58211 6th S |
Outputting "entire nodes" 2, Hakan Pettersson | Date | RE: XML to WML, Lisa van Gelder |
Month |