XML Validation in .NET 2.0 C#
-
I am having a weird problem while validating an XML file against its schema. I am setting XmlReaderSettings to xml schema, add the ValidationEventHandler and then create the xml reader. But it throws an exception: ------------------ A first chance exception of type 'System.Xml.Schema.XmlSchemaValidationException' occurred in System.Xml.dll validate function threw an exception of type 'System.Xml.Schema.XmlSchemaValidationException' base {System.Xml.Schema.XmlSchemaException}: {"It is an error for both 'length' and either 'minLength' or 'maxLength' to be members of {facets}, unless they are specified in different derivation steps. In which case the following must be true: the {value} of 'minLength' <= the {value} of 'length' <= the {value} of 'maxLength'."} SourceObject: null ----------------------- I have validated the same xml file against the same schema using Oxygen XML Editor and XML Spy and these tools consider it a valid document. Now after that I opened the schema in VS 2005, it underlines the xsd:length attribute and tootip gives the same error. But the above mentioned third party tools consider it valid attribute. Any thoughts will be highly appreciated
-----
-
I am having a weird problem while validating an XML file against its schema. I am setting XmlReaderSettings to xml schema, add the ValidationEventHandler and then create the xml reader. But it throws an exception: ------------------ A first chance exception of type 'System.Xml.Schema.XmlSchemaValidationException' occurred in System.Xml.dll validate function threw an exception of type 'System.Xml.Schema.XmlSchemaValidationException' base {System.Xml.Schema.XmlSchemaException}: {"It is an error for both 'length' and either 'minLength' or 'maxLength' to be members of {facets}, unless they are specified in different derivation steps. In which case the following must be true: the {value} of 'minLength' <= the {value} of 'length' <= the {value} of 'maxLength'."} SourceObject: null ----------------------- I have validated the same xml file against the same schema using Oxygen XML Editor and XML Spy and these tools consider it a valid document. Now after that I opened the schema in VS 2005, it underlines the xsd:length attribute and tootip gives the same error. But the above mentioned third party tools consider it valid attribute. Any thoughts will be highly appreciated
-----
See http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1590647&SiteID=1[^].
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe