Attention: We are retiring the ASP.NET Community Blogs. Learn more >

[Tools] XSD Inference Utility

Microsoft has a useful and free XSD Infererence 1.0 utility somewhat hidden on GotDotNet (linked from the worthwhile XML Tools page).  The download contains a core library, a simple command line utility, and source code.  The XSD Infererence 1.0 page (in spite of missing some image links) contains a "workable" Web interface you can use to quickly test the idea by submitting your own small XML file.  The overview page gives some description of the idea and the utility and points to Generate XSD Schemas by Inference and Modeling biz docs in XML, two articles about this technique and tool.  The download link on the is bad, so use the link on the page (or above).  MSDN currently hosts a very solid tutorial article, Using the XSD Inference Utility, that gives you most of what you need to know to go beyond the simple Infer.exe command line utility and use the Microsoft.XSDInference.Infer class from your own code.

Consider your results from using the XSD Infererence 1.0 utility as a starting point rather than an end product.  You should carefully review the inferred schema and intelligently edit it into something real.  What you get from XSD inference probably will not give you a really good schema.  That still takes some thought, however, and the tool certainly can save you some time.  It certainly is cheaper than buying an expensive commercial XML IDE just to autogenerate some XML Schemas!  If you ever worked for a company that bought XMLSpy just for this purpose, you know what I mean.  Be sure to read about the tool's caveats and limitations - particularly, don't miss the 1 MB size limitation part.  The download contains an excellent help file.

I have found this tool useful and certainly recommend adding it to your .NET tool belt.

Also, if you have used the Xsd.exe tool, you may also want to have a look at the XSD Object Code Generator tool on the XML Tools page.  While similar to Xsd.exe, the XSD Object Code Generator tool claims to create an "enhanced class structure" and to handle "many more common schema types."


1 Comment

Comments have been disabled for this content.