Java에서 작은 데스크탑 응용 프로그램을 개발 중입니다. 내가 어디 XML 파일에서 데이터를 읽을 필요가 지점을 가로 질러 왔어, 내가 Dom4j 라이브러리를 사용하고 있습니다. 나는 다음과 같은 오류가 직면하고 코딩하는 동안 사람이 오류 해결에 나를 인도 할 수 : 메서드 서명 이후Dom4j : 컴파일시 "호환되지 않는 유형"오류가 발생했습니다.
public void FromXML(String sXMLFileURI)
{//Reads the XML File and Stroe Data in Calling Object
Document document = getDocument(sXMLFileURI);
String xPath = "myXpath";
List<Node> nodes = document.selectNodes(xPath);//This line gives the followiing error:
//error "incompatible types
//required: java.util.List<org.dom4j.Node>
//found: java.util.List<capture#1 of ? extends org.dom4j.Node>"
for (Node node : nodes)
{
//some processing here
}
}