I've downloaded the latest JDom2 beta today and am working to
incorporate it into some new code. I am developing against Java6, so I
would expect iterators to work. However, the following code fails to
compile (with JDom2 includes):<br>
<br>SAXBuilder sax = new SAXBuilder();<br>Document xml = sax.build (source); // source is a File object<br>Element root = xml.getRootElement();<br>ElementFilter tableFilter = new ElementFilter ("Table");<br>
int tableCount = 0;<br>
for (Element table : root.getDescendants(<div id=":126">tableFilter)) {<br> tableCount++;<br>}<br><br>The
compile-time error that I get states, "Can only iterate over an array
or an instance of java.lang.Iterable". Since Element.getDescendants
(Filter<F>) returns a java.util.Iterator<F>, I would expect
my code to compile and work. What am I missing?<br>
<br>Sincerely,<br>Craig</div>