[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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)
singer attributes
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
procedure.

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

"

>> 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

-----------------------------------------------------------------
        Visit our Internet site at http://www.reuters.com

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:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.