Subject: Re: [xsl] Selecting/matching based on inherited attributes From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 18 Apr 2002 18:21:50 -0400 |
I know how to check the ancestor value from within the element's content:
eg: <xsl:if test="ancestor-or-self::*[@att1][1]/[@att1='d'] and ancestor-or-self::*[@att2][1]/[@att2='c']">
But that would mean walking through the entire nodeset each time I wanted to create output.
Is there a way to check from outside the element?
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".
"//myelem[ancestor-or-self::*[@att1][1][@att1='d'] and ancestor-or-self::*[@att2][1][@att2='c']]"/>
"all myelem elements for which a first ancestor-or-self with an @att1 has @att1='d' and a first ancestor-or-self with an @att2 has @att2='c'"
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Selecting/matching based on i, mpriestl | Thread | Re: [xsl] Selecting/matching based , Jeni Tennison |
Re: [xsl] Invalid Character, Wendell Piez | Date | Re: [xsl] Schema Exploration..., Mark Diggory |
Month |