Hi everyone i'm trying to parse xml files using java using code below..
try{
DocumentBuilderFactory docFactory=DocumentBuilderFactory.newInstance();
DocumentBuilder docBulider=docFactory.newDocumentBuilder();
Document config_doc=docBulider.parse("config/appconfig.xml");
config_doc.getDocumentElement().normalize();
Node n =config_doc.getDocumentElement();
NodeList list= n.getChildNodes();
for(int i=0;i<list.getLength();i++){
System.out.print(list.item(i));
if(list.item(i).getNodeName().equalsIgnoreCase("version-name")){
name=list.item(i).getNodeValue();
}
}
}
catch (Exception e){e.printStackTrace();}
My file layout is like this

I keep getting file not found exception. I also used
getClass().getResouce("config/appconfig.xml").toExternalForm()
and i tried to read as stream too.
Thank you :)