[xsl] nearest ancestor

Subject: [xsl] nearest ancestor
From: Stephane Bailliez <sbailliez@xxxxxxxxxxxxxx>
Date: Mon, 26 Mar 2001 10:43:59 +0100
Hello all,

I have a problem with the nearest ancestor... and the conformance.

Say I have:

<AAA name="1">
  <AAA name="2">
    <AAA name="3">

and my xsl is

<xsl:template match="CCC">
  <xsl:value-of select="(ancestor::AAA)[last()]/@name"/>,
  <xsl:value-of select="(ancestor::AAA)[1]/@name"/>,
  <xsl:value-of select="ancestor::AAA[last()]/@name"/>,
  <xsl:value-of select="ancestor::AAA[1]/@name"/>

MSXML3 gives me 1, 3, 1, 3
Xalan (1.2.2/2.0.x) gives me 3, 1, 1, 3

Reading the 'nearest ancestor' thread a couple of months ago, it seems that
the expected behavior is xalan's (3, 1, 1, 3).

Can anyone confirm this and that MSXML3 incorrectly handles ancestor ?

Thanks for your input.

 Stéphane Bailliez 
 Software Engineer, Paris - France 
 iMediation - http://www.imediation.com 
 Disclaimer: All the opinions expressed above are mine and not those from my

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

Current Thread