This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: counting the number of following siblings



> I am trying to write a function that tests that the current 
> node is of type
> D and that the number of following D type nodes is greater 
> than 3. Something
> like this:
> 
> <xsl:when test="./@type='D' and
> count(following-sibling::faostat:table-row[1]/@type='D')&gt3">
> 
> .....
> 
> </xsl:when>
> 
> My problem is with the
> "count(following-sibling::faostat:table-row[1]/@type='D')&gt3" aspect.


  following-sibling::faostat:table-row[1]/@type='D'

will return a boolean and count() expects a node-set. 

  count(following-sibling::faostat:table-row[@type='D']) > 3 

should work

J

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]