Bonjour
Voila mon problème, je valide un fichier XML via un schéma xsd avec un parser SAX.
Fichier XML :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 <MESSAGES NbMessage="10"> <MESSAGE object = "toto" > <CONTENT> <![CDATA[/*************/]]> </CONTENT> </MESSAGE> <MESSAGE object = "tata" > <CONTENT> <![CDATA[/*************/]]> </CONTENT> </MESSAGE> ... </MESSAGES>Si j'ai 2 balises
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 SAXParser parser = new SAXParser(); parser.setFeature("http://xml.org/sax/features/validation", true); parser.setFeature("http://apache.org/xml/features/validation/schema", true); parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation",schema) parser.setErrorHandler(new MyErrorHandler()); parser.parse("fichier.xml");
</MESSAGE><MESSAGE> collées qui se suivent, mais qui correspondent à 2 éléments différentes de mon arbre, j'ai une exception :
Code : Sélectionner tout - Visualiser dans une fenêtre à part org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
Quelqu'un peut-il svp m'aider sur ce problème?
Merci d'avance
@+
Partager