Java 类型节点的方法getTextContent()未定义

Java 类型节点的方法getTextContent()未定义,java,xml,oracle11g,Java,Xml,Oracle11g,我尝试阅读一个XML文档。因此,我使用OracleXMLParser methode getTextContent()给了我一些问题。检索节点名没有问题。但我无法检索该值。我尝试了getNodeValue,但返回null 这是xml <?xml version="1.0"?> <root> <test> <name>first</name> </test>

我尝试阅读一个XML文档。因此,我使用OracleXMLParser

methode getTextContent()给了我一些问题。检索节点名没有问题。但我无法检索该值。我尝试了getNodeValue,但返回null

这是xml

<?xml version="1.0"?>
    <root>
        <test>
            <name>first</name>
        </test>
    </root>
和控制台

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    The method getTextContent() is undefined for the type Node

可能有些类路径混淆了。您确定只使用一个库来处理XML内容吗?有什么进口错误吗?我使用的是来自w3c的:“import org.w3c.dom.Node;”,效果很好。这里是我在今年年初创建的一个旧类:它使用xml文件存储级别信息。如果你看一看,也许会对你有所帮助。祝你好运@Joeri Venekamp,在
rules.getElementsByTagName()
中,什么是
规则
?我输入了一个错误,使代码更通用。修正了输入错误。我必须使用oracle的XMLParser。对于应用程序,必须在oracle SOA套件中运行
Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    The method getTextContent() is undefined for the type Node