Le fichier spécifié est introuvable?
Bonsoir,
je suis nouveau dans le monde java,j'ai essayé ce code mais j'ai un message d'erreur pourtant j'ai copié le fichier test.xml dans le dossier src
des idées???
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
public static void main (String args[])
throws Exception
{
XMLReader xr = XMLReaderFactory.createXMLReader();
MySAXHandler handler = new MySAXHandler();
xr.setContentHandler(handler);
xr.setErrorHandler(handler);
FileReader r = new FileReader("test.xml");
xr.parse(new InputSource(r));
//}
} |
j'ai ce message d'errueur Exception in thread "main" java.io.FileNotFoundException: test.xml (Le fichier spécifié est introuvable)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileReader.<init>(Unknown Source)
at ParseXMLAndCo.Test.main(Test.java:15)