xsl-list
[Top] [All Lists]

ancestor axis ordering (again...)

2006-02-27 06:43:45
hi *!


this template

<xsl:template match="d">
  ancestor axis: <xsl:for-each select="ancestor::*">
    <xsl:value-of select="name()"/>
  </xsl:for-each>

  last element: <xsl:value-of select="name(ancestor::*[last()])"/>

</xsl:template>

will convert this source

<a>
  <b>
    <c>
      <d/>
    </c>
  </b>
</a>

into

 ancestor axis: abc

 last element: a


why?

the spec says that the ancestor axis is a reverse axis. but then the for-each statement would be wrong. from my understanding, it should produce "cba".

i found this explanation http://www.biglist.com/lists/xsl-list/archives/200405/msg00055.html
in the archive, but i don't understand the concept of "steps".
can anyone explain? sorry if this is a faq.

thanks,

jörn


--
jörn nettingsmeier

home://germany/45128 essen/lortzingstr. 11/
http://spunk.dnsalias.org
phone://+49/201/491621

if you are a free (as in "free speech") software developer
and you happen to be travelling near my home, drop me a line
and come round for a free (as in "free beer") beer. :-D

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>