xsl-list
[Top] [All Lists]

Re: [xsl] Diagram of XPath axes

2012-05-24 17:45:31


On 2012-05-25 00:11, Wendell Piez wrote:
Hi,

A rare slip from Gerrit? who surely means

select="//*[. << current()]"

Yes, of course. Thanks, Wendell, for the correction, and for 'rare'.

For the sake of completeness:

<doc>
  <a/>
  <b>
    <c/>
  </b>
</doc>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="2.0" >
  <xsl:output method="text" />
  <xsl:template match="c">
    <xsl:message>preceding
      <xsl:value-of select="preceding::*/name()" />
    </xsl:message>
    <xsl:message>&lt;&lt;
      <xsl:value-of select="//*[. &lt;&lt; current()]/name()" />
    </xsl:message>
    <xsl:message>ancestor | preceding
      <xsl:value-of select="(ancestor::* | preceding::*)/name()" />
    </xsl:message>
  </xsl:template>
</xsl:stylesheet>

⇒

preceding
      a
&lt;&lt;
      doc a b
ancestor | preceding
      doc a b


--~------------------------------------------------------------------
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>