-1

I am creating small application in which i am reading data from XML.

I am using XmlSearializer to read data from xml.

But before reading i am validating the xml using xsd.

So in validating xml using xsd i am having some cases which i think can not be implemented using xsd.

Some validation is based on value of other element.

So i want to make all these validation before i read data from xml.

So is there any way how can i validate xml before reading data and cases that can not be implemented using XSD?

Thanks for support.

Nirav Kamani
  • 3,192
  • 7
  • 39
  • 68

1 Answers1

0

I think it's not possible with XSD

See the other answers:

Community
  • 1
  • 1
Manish Dalal
  • 1,768
  • 1
  • 10
  • 14
  • Hello ya i read this.. But i am having very big cases of validation so in that case doing validation only by reading data remains very complex and requires long code so is there any other way before reading data do validation not only using XSD and programmatically. – Nirav Kamani Apr 27 '14 at 13:32
  • If i would have to do this, I would have written an XSD with whatever is possible, and for the rest, I would have written code to perform custom validation. The application that I create would have first validated against xsd and then (if xsd validation passed) against the custom rules (which are not supported in xsd) – Manish Dalal Apr 27 '14 at 18:08