In my project I am facing a problem stating
The method getTextContent() is undefined for the type Node
I am currently using jdk 1.5, can anybody tell me what 开发者_StackOverflowthis is about.
If you are getting this problem in Eclipse
, my tested solution would be:
Java Build Path
→ Order and Export
, select JRE System Library
and move it to Top
Java Build Path -> Order and Export tab, selected the JRE. Clicked the "UP" button to move it to the upper.
As there are lot of class named Node in the JVM, I would say that you imported the wrong one. Check your imports, verify this is the class you really want to use and try again.
If you are getting this problem in eclipse IDE then fix it by doing :
Right click project, select Properties -> Java Build Path.
Though we will eventually need to use the "Order and Export" tab, it's a very long list, and there's actually a shortcut to finding the xml-apis-1.0.b2.jar file we want to move. Go to the Libraries tab which lists things alphabetically. Scroll down the the x's and single click that entry. Don't click the checkmark, just the name.
Now switch back to the Order and Export tab scroll down, you'll notice that library is still highlighted, pretty cool!
Click the Bottom button on the right, to move it all the way down. It should show up AFTER the special "JRE System Library [JVM ...." entry. And it should not have a checkmark.
follow below link more help: http://www.enterprisesearchblog.com/2009/09/fix-for-gettextcontent-is-undefined-for-the-type-node-for-solr-project-in-eclipse-ide.html
You are probably having your project settings (assuming you are using Eclipse or some other IDE) to Java 1.4. Java 1.4's org.w3c.dom.Node
class does not have that method (it was introduced in Java 5).
You, or the code you are using, is calling a method called getTextContent() which is not defined for the Node Object. The explanation by the compiler is pretty good in this case.
精彩评论