java - Issue with GWT XML Parser using cast to Element -
i using gwt xml parser parse xml file on app. next example: http://www.gwtproject.org/doc/latest/devguidecodingbasicsxml.html
but error during class cast. here stack trace:
error: failed create instance of 'xds.metadata.editor.client.editor.documentmodeleditorview' via deferred binding java.lang.classcastexception: com.google.gwt.xml.client.impl.elementimpl cannot cast com.google.gwt.user.client.element and here sources:
document dom= xmlparser.parse(preparse.getinstance() .dopreparse(appresources.instance.codes().gettext())); list<codedterm> classcodes=new arraylist<codedterm>(); nodelist nodes= dom.getelementsbytagname("codetype"); if (predefinedcodes.equals(predefinedcodes.class_codes)){ if (classcodes.size()==0) { int index = 0; // during next line error while (!((element) nodes.item(index)).getattribute("name").equals("classcode")) { index++; } // .... } } can explain me why classcastexception whereas same thing in gwt-project sample code?
thank you.
solved it. importing wrong element class.
be carefull import com.google.gwt.xml.client.element; , not else.
java xml gwt xml-parsing
No comments:
Post a Comment