Bonjour,
Voilà tout est dans le titre.
D'un coté j'ai une feuille XML, de l'autre un fichier XSD comment puis -je valider , mon XML ?
J'suis super en galère.
d'Avance Merci
Publicité
Posté le 16-10-2006 à 20:27:28
lonely
Posté le 17-10-2006 à 21:22:05
The simplest way to validate an XML document is to use a Validator object. This object will perform a validation against the Schema object from which the Validator was created. Schema objects are typically created from SchemaFactory objects. The static newInstance() object allows you to create a SchemaFactory using a preset XML schema. The following code demonstrates this:
Calling the validate() method on the Validator object performs the actual validation. This method takes at least a javax.xml.transform.Source object, of which you can use a SAXSource or a DOMSource, depending on your preference.