validating XML against given XSD
i have a xml file & a given xsd
XML file will be created from any source of data
after the file creation i need to just validate/ check the data against the given xsd
ie if a field is defined a numeric and if any charcter is entered in it than it shld display the invalid data error msg
if a field needs to contain a date field & if the data is invalid as checked against the xsd it shld display the message
is this way of validation for XML possible against a given XSD??
or how do i solve this issue
You can restrict content to allow for detailed validation using the XSD:
However, the validation result depends upon what you are intending to use to perform the validation!?
currently i am referring http://vbcity.com/forums/p/129777/553868.aspx which has a good example
but the only prblm is i not able to select any other xml document
i need to allow the users to select the xml docuument & the associated xsd shd automically be taken
is there any such example
i dont need to give the validation parsmeters
i am given both xml and xsd i need to validate the xml against xsd
I am not aware of any standard example for this. However, your issue lies with the UI design and implementation not with the XML and it's validation.
Try looking at the OpenFileDialog of Windows Forms or similar if using WPF.
Additionally, I am not aware of anything that will automatically detect the schema in .NET. I believe XML editors key off of the xsi:noSchemaNamespace attribute, which is normally used to define the path of the schema. This path could be resolved to a schema, alternatively you would need to add the functionality to allow the user to specify the schema in addition to the XML.
Last Post: 10-20-2010, 11:50 AM
By teclioness in forum .NET
Last Post: 10-07-2005, 08:10 AM
By Tim in forum xml.announcements
Last Post: 10-11-2001, 05:00 PM
By xmlstartkabel in forum XML
Last Post: 10-10-2001, 05:07 AM
By Tim Frost in forum xml.announcements
Last Post: 04-02-2001, 11:53 AM
Tags for this Thread
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL