Bonjour,
j'ai voulu manipuler un fichier xml nommer "Exercice 2.xml" avec jdom
voisi le code:
public static void main(String[] args)
{
//L'on crée un instance du parseur SAXBuilder
SAXBuilder sxb = new SAXBuilder();
try
{
//L'on crée un nouveau document JDOM avec en argumant le fichier XML
//Le parsing est terminé ;)
document = sxb.build(new File("Exercice 1.xml"));
}
catch(Exception e){}
//L'on initialise un nouvel element racine avec l'element racine du document.
racine = document.getRootElement();
//Méthode pour l'affichage du fichier
afficheALL();
}
le probleme c'est qu'il s'est produit cette exception:
Exception in thread "main" java.lang.NullPointerException
at JDOM2.main(JDOM2.java:39)
c a d document = sxb.build(new File("Exercice 1.xml")); n'a pas été réussi
j'ai pas arriver a resoudre ce probleme
Configuration: Windows XP
Opera 9.24