Hi,
I am trying to parse an xml file and then for each xml entry, im
parsing another xml file into for loop and then creating vertical
panels and adding labels to the content of the second xml file.
This is my code:
try
{
Request request = builder.sendRequest(null, new
RequestCallback()
{
@Override
public void onError(Request request, Throwable
exception) {}
public int j =0;
@Override
public void onResponseReceived(Request request,
Response response)
{
Document xmlDoc =
XMLParser.parse(response.getText());
XMLParser.removeWhitespace(xmlDoc);
Element root =
xmlDoc.getDocumentElement();
NodeList URLs = root.getChildNodes();
for ( j = 0; j < 2; j++)
{
v1[j] = new VerticalPanel();
String str =
URLs.item(j).getAttributes().toString();
System.out.println(str);
tab.add(v1[j],str.substring(13,16));
RequestBuilder builder1 = new RequestBuilder
(RequestBuilder.GET,str.substring(13,16)+".mdl");
try
{
Request request1 = builder1.sendRequest(null, new
RequestCallback()
{
public void onError(Request request1, Throwable
exception) {
}
@Override
public void onResponseReceived(Request request1,
Response response1)
{
Document xmlDoc1 =
XMLParser.parse(response1.getText());
XMLParser.removeWhitespace(xmlDoc1);
Element root1 =
xmlDoc1.getDocumentElement();
NodeList URLs1 = root1.getChildNodes();
for (int i =0; i <URLs1.getLength();i++)
{
String str1 =
URLs1.item(i).getAttributes().toString();
System.out.println(str1);
v1[j].add(new Label ("hi"));
// this line creates the error
}
}
});
}
catch(RequestException e){ }
//end of for loop
}
}
});
}
catch(RequestException e) {}
I have commented the line by which i get the error, why is that?
i could not see whts wrong in my code
please help
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---