No source code is available for type com.google.gwt.xml.client.XMLParser Erorr

925 views
Skip to first unread message

taha

unread,
Jan 31, 2009, 11:03:43 AM1/31/09
to Google Web Toolkit
i wanna use XMLParser class in my project but i've faced below error
message
"No source code is available for type
com.google.gwt.xml.client.XMLParser; did you forget to inherit a
required module?"


my code is

package org.nts.client;

import com.google.gwt.user.client.ui.DecoratorPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.HTTPRequest;
import com.google.gwt.user.client.ResponseTextHandler;
import com.google.gwt.xml.client.*;

public class IntroPanel extends DecoratorPanel {

static final String TERM_PATH = "term.xml";
static final String TERM_TAG = "term";
static final String ATTRIBUTE_ID= "id";
static final String ATTRIBUTE_NAME = "name";
private VerticalPanel panel = new VerticalPanel();
private ListBox termList = new ListBox(false);

public IntroPanel() {
setWidth("900px");
HTTPRequest.asyncGet(TERM_PATH, new ResponseTextHandler() {
public void onCompletion(String responseText) {
XMLParser.parse(responseText);
NodeList terms = document.getElementsByTagName(TERM_TAG);
for (int i=0; i < terms.getLength(); i++) {
Element currentElement = (Element)terms.item(i);
String item = currentElement.getAttribute(ATTRIBUTE_ID);
String value = currentElement.getAttribute(ATTRIBUTE_NAME);
termList.addItem(item, value);
}
}
});

panel.add(termList);
}
}

Ian Petersen

unread,
Jan 31, 2009, 1:46:04 PM1/31/09
to Google-We...@googlegroups.com
On Sat, Jan 31, 2009 at 8:03 AM, taha <tah...@gmail.com> wrote:
> i wanna use XMLParser class in my project but i've faced below error
> message
> "No source code is available for type
> com.google.gwt.xml.client.XMLParser; did you forget to inherit a
> required module?"

Just a guess, but did you forget to inherit a required module? If you
want the GWT compiler to find the source, it has to be reachable from
your module or, transitively, from the modules your module inherits.
Maybe you have to inherit something non-default to get the XMLParser.

Ian

hazy1

unread,
Jan 31, 2009, 10:30:11 PM1/31/09
to Google Web Toolkit
Add the xml module to your gwt.xml.

taha

unread,
Feb 1, 2009, 12:21:40 AM2/1/09
to Google-We...@googlegroups.com
thank you for instruction
problem solved by adding gwt.xml modul
<inherits name ="com.google.gwt.xml.XML"/>
taha_ir.vcf
Reply all
Reply to author
Forward
0 new messages