This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Selecting/matching based on inherited attributes


> eg (knowing this is illegal, but trying to show intent):
> 
> <xsl:apply-templates 
> select="//myelem/[ancestor-or-self::*[@att1][1]/[@att1
> ='d']][ancestor-or-self::*[@att2][1]/[@att2='c']]"/>
> 
> in plain english: apply templates to all "myelem" nodes that have a
> closest-att1 of "d" and a closest-att2 of "c".

select="//myelem[(ancestor-or-self::*/@att1)[last()]='d' and
                 (ancestor-or-self::*/@att2)[last()]='c']"


Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com 

 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]