1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
public void ValiderSyntaxeDemande(FicheInstallation fiche)
{
try
{
XmlReaderSettings adresseSetting = new XmlReaderSettings();
adresseSetting.Schemas.Add("http://www.xxx.com/FicheInstallation/", ConfigurationManager.AppSettings["schemaValidation"]);
adresseSetting.ValidationType = ValidationType.Schema;
adresseSetting.ValidationEventHandler += new ValidationEventHandler(ValidationEventHandler);
System.IO.StringReader tx = new System.IO.StringReader(fiche.Xml);
XmlReader xmlAdresse = XmlReader.Create(tx, adresseSetting);
while (xmlAdresse.Read()) { }
}
catch (XmlException XmlExp)
{
throw XmlExp;
}
catch (XmlSchemaException XmlSchExp)
{
throw XmlSchExp;
}
catch (Exception GenExp)
{
throw GenExp;
}
} |