你的字符串书写格式不对,应为"file:e:/try/web-inf/classes/fxml.xml";。
String uri = "file:" + new File( name ).getAbsolutePath(); // 使用JAXP作为解析器
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
org.w3c.dom.Document document = db.parse( uri );
String uri = "file:" + new File( name ).getAbsolutePath(); // 使用JAXP作为解析器
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
javax.xml.parsers.DocumentBuilder db = dbf.newDocumentBuilder();
org.w3c.dom.Document document = db.parse( uri );
MyParser.parse("e:/try/web-inf/classes/fxml.xml");