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]

Counting nodes


Hello

Let's say I have an xml file that look like this:

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<board>
  <row>
    <cell type="start" name="Case0" pos="0"/>
    <cell type="bp" name="Case1" pos="1"/>
    <cell type="qcm" name="Case2" pos="2"/>
    <cell type="luck" name="Case3" pos="3"/>
    <cell/>
  </row>
  <row>
    <cell/>
    <cell/>
    <cell/>
    <cell type="qcm" name="Case4" pos="4"/>
    <cell/>
  </row>
</board>

I'd like to know if it possible to count the not empty <cell> node using
xslt
eg to have a result like this:

<numberofcells>5</numberofcells>

Thanks

-- 
Gilles Durys
Gilles.Durys@nefy.ucl.ac.be


 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]