title: JAVA ODFDOM: How to get integer values from ODF sheet
body: <p>I am using this code to get maximum row count from a sheet in ODF</p>
  
  <pre><code>public int getRowCount(String sheetName) throws XPathExpressionException, Exception
  
  {
  
  //reset rowCount to zero
  
          rowCount=0;
  
  //xpath to reach Nodes of cell in first row
  
          int parameterCount=getColumnCount(sheetName);
          //System.out.println("Debug:ParameterCount="+parameterCount);
          for (int i=1;i&lt;=parameterCount;i++)
          {
              String xpathStr="//table:table[@table:name='"+sheetName+"']/table:table-row/table:table-cell["+i+"][@office:value-type='void']";
              DTMNodeList nodeList = (DTMNodeList) xpath.evaluate(xpathStr, spreadSheet.getContentDom(), XPathConstants.NODESET);
              //System.out.println("Debug:RowsFoundWithData="+nodeList.getLength());
              System.out.println(nodeList.getLength());
              for(int j=0 ; j&lt;nodeList.getLength();j++)
              {
                  System.out.println("Debug:RowValue="+nodeList.item(j).getTextContent());
              }
              if(nodeList.getLength()-1&gt;rowCount)
              {
                  rowCount=nodeList.getLength()-1;
              }
  
      }
  
  return rowCount;
  
      }
  </code></pre>
  
  <p>But this code only returns me non integer value count, if any row of a column in sheet contains integer value then it skips it and row Count returned by this function is not valid</p>
  
  <p>It only counts alphanumeric values rows</p>
  
  <p>Is there any way by which i can get correct row count</p>
  
  <p>JAR used odfdom-java-0.8.7-jar-with-dependencies</p>