Hey everyone,
I'm getting an IllegalCastException on the following (see bold line):
public void renderXML(final String xml) {
final Document xmlDoc = XMLParser.parse(xml);
final com.google.gwt.xml.client.Element root = xmlDoc.getDocumentElement();
XMLParser.removeWhitespace(xmlDoc);
final NodeList collection = root.getElementsByTagName("collection");
for (int i = 0; i < collection.getLength(); i++) {
**final Element coll= (Element)collection.item(i);**
RootPanel.get("slot2").add(new Label("coll: "));
}
}
Does anyone know why this is so? I've looked at examples, and it seems that this is supposed to be how to do it. I am using the following related imports:
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.NodeList;
import com.google.gwt.xml.client.XMLParser;
One thing to make note of here...Element is imported as "import com.google.gwt.dom.client.Element;", I cannot import "import com.google.gwt.xml.client.XMLParser;" as it will give me the error:
"The import com.google.gwt.xml.client.Element collides with another import statement"
Any suggestions? Thanks!