limitations of preceding-sibling and following-sibling

Subject: limitations of preceding-sibling and following-sibling
From: Earl Bingham <earl@xxxxxxxxxxxxxx>
Date: Thu, 21 Oct 1999 20:14:04 -0700 (PDT)
I'm hitting a limitation of xPath with
preceding-sibling and following-sibling. In
which I'm having trouble creating the following:

<ul>
 <li>first list element</li>
 <li>second list element</li>
<ul>
<text>some text</text>
<ul>
 <li>another list</li>
 <li>second anon list</li>
</ul>


from the following:

<textItems>
  <bullet>first list element</bullet>
  <bullet>second list element</bullet>
  <normal>some text</normal>
  <bullet>another list</bullet>
  <bullet>second anon list</bullet>
</textItems>

I have the following stylesheet that will grab
the first group of bullets, but it will grab
all the bullets and not seperate the other
group of bullets. These appears to be a limitation
of axis groupings.

<xsl:for-each select="//normal|//bullet">
<xsl:choose>
  <xsl:when select="self::normal">
  </xsl:when>
  <xsl:when select="self::bullet">
    <xsl:if test="not(preceding-sibling::bullet)">
      <ul>
      <xsl:for-each select="self::bullet|following::bullet">
        <li><xsl:value-of select="."/></li>
      </xsl:for-each>
      </ul>
    </xsl:if>
  </xsl:when>
</xsl:choose>
</xsl:for-each>


Earl Bingham
1568 Plateau Avenue
Los Altos Hills, CA 94024
H: (650) 559-1738
C: (408) 806-6642

____________________________________________________
get your permanent, free email at http://www.flashemail.com


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


Current Thread