We help IT Professionals succeed at work.

Use of XSD

rowternet
rowternet used Ask the Experts™
on
Hi,

Can anyone explain why XSD is used?
As a .Net developer where will you use it?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
an xsd is an xml document that describes the valid structure of other xml documents.

as an app developer you would use it:

1. To validate any XML you are producing AND/OR
2. To validate any XML you are consuming (from another source).

Author

Commented:
Hi basicinstinct,

So, every time you read a XML file do you validate it against a XSD file?
Is this a recommended practice?

How do you generate a XSD file?

Thanks
well yes its kind of pretty standard way of validating your xml.
here is how you create xsd from xml:-

http://www.flame-ware.com/products/xml-2-xsd/
http://msdn.microsoft.com/en-us/library/x6c1kb0s%28v=vs.80%29.aspx
what we do, during development we want validation ON.
somewhere between dev and prod we turn it off - we definitely don't leave it on in production because:

1. It's too late to care about invalid XML - it either works or it doesn't, our users don't care if they get an exception or a validation error - both ways they can't continue.
2. The performance overhead is undesirable in prod.

Author

Commented:
Thanks