public int getNodeCount ( String strKey ) { int iCount = 0 ; Node node = this . getNode ( null , strKey , CreateMode . DONT_CREATE , false ) ; if ( node != null ) { String key = strKey ; if ( key . lastIndexOf ( ' ' ) != - 1 ) key = key . substring ( key . lastIndexOf ( ' ' ) + 1 ) ; Node nodeStart = node . getParentNode ( ) ; NodeList nodeList = ( ( Element ) nodeStart ) . getElementsByTagName ( key ) ; if ( nodeList != null ) { for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { if ( nodeList . item ( i ) . getParentNode ( ) == nodeStart ) iCount ++ ; // Get the last child. } } } return iCount ; // Override this }
Get the number of data nodes at this path in the data .