xsl-list
[Top] [All Lists]

Antw: counting nodes before and aften an specific one

2002-11-26 02:53:11
Hi Ani,
you may use an expression in your count() statement.

cheers,
markus 


<xsl:template match="form-tab">
        <xsl:variable name="count_inactive">

<!-- here we go -->
        <xsl:value-of select="count(tab[(_at_)active !='1'])"/>

        </xsl:variable>
        <xsl:message>
        there are
        <xsl:value-of select="$count_inactive"/>
        inactive entries
        </xsl:message>
</xsl:template>

aniceto(_at_)overthenet(_dot_)tv 26.11.2002  10.34 Uhr >>>
Hi xsl people.

xml sample
<form-tab>
  <tab active="0" name="GENERAL"/>
  <tab active="0" name="CONTABLES"/>
  <tab active="1" name="NOTAS"/>
  <tab active="0" name="DOCUMENTOS"/>
  <tab active="0" name="NOTAS"/>
  <tab active="0" name="RELACIONES"/>
</form-tab>

how can I count the nodes before the one @active=1
ant the ones after, assuming there is only one active

any idea?

thanks in advance
Ani

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



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



<Prev in Thread] Current Thread [Next in Thread>
  • Antw: counting nodes before and aften an specific one, Markus Frommherz <=