I have some Java code to parse an XML file. My code is returning null for my nodes, however.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = builder.parse( new File( path ) );
rootElement = doc.getDocumentElement();
String str = rootElement.getLocalName();
When I print str, I get null. The path to the XML file is correct. Any ideas what might be the problem?