define: cannot convert org.w3c.dom.domElement to boolean
<p>I have translated the following Javascript code to Java. The problem occurs at sib;
<a href="http://snippets.dzone.com/posts/show/3754" rel="nofollow">http://snippets.dzone.com/posts/show/3754</a></p>

<p>I have never seen such for statements. What does it do exactly when you add a semicolon? Is this like while() statement?</p>

<pre><code> public static String getElementXpath(DOMElement elt){
        String path = ""; 
        for (;elt.ELEMENT_NODE == elt.getNodeType(); elt = (DOMElement) elt.getParentNode()){
            int idx = getElementIdx(elt);
        }
        return path;        
    }

    private static int getElementIdx(DOMElement elt) {
        int count = 1;

         for (DOMElement sib = (DOMElement) elt.getPreviousSibling(); sib ; sib = (DOMElement) sib.getPreviousSibling())
            {
                if(sib.ELEMENT_NODE == sib.getNodeType() &amp;&amp; sib.getTagName() == elt.getTagName()) count++;
            }

        return count;
    }
</code></pre>
