bonjour,
je cherche à parser un document xml contenu sur mon disque dur pour en recup les données.Et j'ai plusieur question.
-Comment faire parser un fichier contenu sur mon DD?
-sinon j'ai trouvé quelque script d'exemple mais ca me marque un message d'erreur:
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(Unknown Source)
at MyParser.<init>(MyParser.java:10)
at MyParser.main(MyParser.java:20)
import java.io.IOException;
import org.apache.*
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.helpers.XMLReaderFactory;
public class SimpleSaxParser {
public SimpleSaxParser(String uri) throws SAXException, IOException {
XMLReader saxReader = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
saxReader.setContentHandler(new SimpleContentHandler());
saxReader.parse(uri);
}
public static void main(String[] args) {
if (0 == args.length || 2 < args.length) {
System.out.println("Usage : SimpleSaxParser uri [parserClassName]");
System.exit(1);
}
String uri = args[0];
String parserName = null;
if (2 == args.length) {
parserName = args[1];
}
try {
SimpleSaxParser parser = new SimpleSaxParser(uri);
} catch (Throwable t) {
t.printStackTrace();
}
}
}
et je comprend pas trop le problème si vous pouvez me donner un coup de main merci

