قسم الرياضيات و الإعلام الإليwww.univ-soukahras.dz/ar/dept/mi |
2 votes
|
this is y code try { File file = new File("/C:/Users/workspacememoire12/aaaaa/src/aaaaa/class.xml"); Document doc = dBuilder.parse(file); System.out.println("Root element :" + doc.getDocumentElement().getNodeName()); if (doc.hasChildNodes()) { printNote(doc.getChildNodes()); } } catch (Exception e) { private static void printNote(NodeList nodeList) { for (int count = 0; count < nodeList.getLength(); count++) { Node tempNode = nodeList.item(count); // make sure it's element node. // get node name and value if (tempNode.hasAttributes()) { // get attributes names and values for (int i = 0; i < nodeMap.getLength(); i++) { Node node = nodeMap.item(i); } } if (tempNode.hasChildNodes()) { // loop again if has child nodes } System.out.println("Node Name =" + tempNode.getNodeName() + " [CLOSE]");
} } this code shown the resut in the consol but a need it in File
|
نشر على 14:56, الأحد 8 ماي 2016 By Meiem Amirat (9 points) |
أجوبة (2)
جواب (1)
-2 votes
|
public class NewMain1 { |
نشر على 17:40, الجمعة 20 ماي 2016 by Mouadh Bekhouche (17 points) |
جواب (2)
1 votes
|
jjust put those lines in the main File file2 = new File("C:\\Users\\ADMIN\\workspace\\MyProject\\file02.xml"); |
نشر على 19:05, السبت 21 ماي 2016 by bendjebbqr hanane (2 points) |