<DIV>Hi,<BR>My xml file looks like this --</DIV>
<DIV><?xml version="1.0" encoding="UTF-8"?><BR><DataSet><BR> <Username>qqlil</Username><BR> <Password>welil1980</Password><BR> <Username>iotin</Username><BR> <Password>cvbtin1975</Password><BR></DataSet ></DIV>
<DIV>i copy the contents in a list and then iterate through it using a iterator. The while(),<BR> loops infinitely and prints only the first element qqlil welil1980. I am not able to get the <BR>second username and password. Is my xml file structure wrong or the code for reading<BR>it is wrong?</DIV>
<DIV>// part of the code</DIV>
<DIV> SAXBuilder builder = new SAXBuilder();<BR> Document doc = builder.build(input);<BR> Element root = doc.getRootElement();<BR> List dataset = doc.getContent();<BR> // System.out.println(dataset);<BR> <BR> Iterator itr = dataset.iterator(); <BR> StringBuffer full = new StringBuffer();<BR> while(itr.hasNext()) {<BR> full.append(root.getChildText("Username") + " ");<BR> full.append(root.getChildText("Password") + " ");<BR> System.out.println(full.toString());
<BR> }</DIV>
<DIV>Thank You,<BR>Salil.<BR></DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://pa.yahoo.com/*http://rd.yahoo.com/evt=1207/*http://promo.yahoo.com/sbc/">SBC Yahoo! DSL</a> - Now only $29.95 per month!