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]

nearest ancestor


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">
      <BBB>
        <CCC/>
      </BBB>
    </AAA>
  </AAA>
</AAA>

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"/>
</xsl:template>

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


 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]