您的位置:首页 > 编程语言 > Java开发

MyEclipse 下 the method getTextContent() is undefined for the type Element

2017-02-20 09:30 603 查看
在myeclipse下

pagefield = dc.createElement("Field");
pagefield.setAttribute("Name", "glDate");
pagefield.setAttribute("type", "Date");
pagefield.setTextContent(glDate);


pagefield.setTextContent(glDate);

这行代码编译报错,提示

the method getTextContent() is undefined for the type Element

原因:

应该使用jdk的rt.jar,

却使用了xml-apis.jar的。

解决方法:

右键项目,java build path,order and export,调整jdk在webAppLibrary的前面,重新编译后完事。

感谢:

http://bbs.csdn.net/topics/110167284
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  myeclipse