Please help! Which return type I need in follow function?
Using java Syntax Highlighting
- public static Node getDoc(String wayToFile){
- /*Create a DOM Parser*/
- try {
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- DocumentBuilder builder = factory.newDocumentBuilder();
- Document document = builder.parse(new FileInputStream(wayToFile));
- Node root = document.getDocumentElement();
- /*handle exception creating DocumentBuilder*/
- } catch(ParserConfigurationException parserError){
- Log.e(TAG, "Parser Configuration Error");
- parserError.printStackTrace();
- }
- /*handle exception reading data from file*/
- catch (IOException fileException){
- Log.e(TAG, "File IO Error");
- fileException.printStackTrace();
- }
- /*handle exception parsing XML*/
- catch(SAXException parceException) {
- Log.e(TAG, "Error Parsing Document");
- parceException.printStackTrace();
- }
- return root;
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
I retriving a error "root cannot be resolved to a variable".


