xsl-list
[Top] [All Lists]

[xsl] Navigation / node-set

2008-05-14 10:08:00
Hi, my problem is that with this code
instead of displaying the first matching preceding-sibling
I display all of them that precede.
How I can diplay just the first matching preceding-sibling?
Thanks



<xsl:template name="randomsearch">
    <xsl:variable name="selcat" select="$SelectCategories"/>
    <xsl:variable name="selran" select="$SearchedString"/>
    <xsl:variable name="filart" select="$FilterArticles"/>
    <xsl:variable name="showsingle" select="$ShowSingleTechno"/>


      <xsl:variable name="witem">

        <xsl:for-each select="(./kbase//title)">
          <xsl:value-of select="substring(., 1,
 2)"/></xsl:for-each></xsl:variable>



    <xsl:for-each select="preceding-sibling::*">
      <xsl:variable name="wx">
        <!--<xsl:value-of select="substring(kbase/title, 1, 2)"/>;;-->

        <xsl:if test="contains(substring(kbase/title, 1, 2),$witem)">
          <!--<xsl:if test="position() != last() ">-->
          <xsl:value-of select="(@id)"/>
        </xsl:if>
        <!--</xsl:if>-->
        <!---->
      </xsl:variable>


      <xsl:if test="string-length($wx) > 0">
        <!-- <xsl:if test="position()=1">-->
        <b>
          <i>
            <a>
              <xsl:attribute name="href">
                http://localhost:1313/?ShowSingleTechno=<xsl:value-of
 select="$wx"/>&amp;SelectCategories=<xsl:value-of
 select="$selcat"/>&amp;SearchedString=<xsl:value-of
 select="$selran"/>&amp;FilterArticles=<xsl:value-of select="$filart"/>
              </xsl:attribute>PREVIOUS
            </a>
           
          </i>
        </b>
      </xsl:if>
    </xsl:for-each>

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