Click here to Skip to main content
11,721,385 members (81,840 online)
Click here to Skip to main content
Articles » Languages » XML » Utilities » Downloads
Add your own
alternative version

XmlToXsd - A Better Schema Generator

, 7 Dec 2010 CPOL 19.2K 1.2K 42
Build better schema for rapid data model prototyping.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Xml.Linq;
using System.Xml.Serialization;

namespace Xml2Xsd
    class Program
        static void Main(string[] args)
            if (args.Length == 0 || !File.Exists(args[0]))

                XsdFromXml.Generate(XDocument.Load(args[0]), "").Save(
                    Path.GetFileNameWithoutExtension(args[0]) + ".xsd");
            catch (Exception x)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Engineer Big Company
United States United States
My professional career began as a developer fixing bugs on Microsoft Word97 and I've been fixing bad habits ever since. Now I do R&D work writing v1 line of business applications mostly in C#/.Net.

I've been an avid pilot/instructor for 13+ years, I've built two airplanes and mostly fly gliders now for fun. I commute in an all-electric 1986 BMW 325 conversion.

I'd like to get back to my academic roots of programming 3D analysis applications to organize complex systems.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150901.1 | Last Updated 7 Dec 2010
Article Copyright 2010 by CodingBruce
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid