Département d'Informatiquehttps://www.univ-soukahras.dz/fr/dept/cs |
- Toutes les Questions
- Questions récentes
- Question sans réponse
- Les Plus Répondues
- Top étudiants
- Posez une Question
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
|
Posté le 14:56, Sunday 8 May 2016 By |
Réponses (2)