How To Generate XSD from XML / Convert XML to XSD

//How To Generate XSD from XML / Convert XML to XSD

How To Generate XSD from XML / Convert XML to XSD

I had to complete a project that involved working with a web service. Problem was, I had the XML files, but needed the XML Schema Definition (XSD) schemas, and coming up with them manually would have been too tedious and would have took too much time. So I went online, and found 2 reliable methods. Oh, and they are free!

Generate XSD from XML Tool

The first is Trang. You can get it here from the official Trang site, or here where I’ve had it mirrored: Download Trang

Using it is simple: Just extract it, then go to your command-line, and run it against any XML document that you may have. Trang is written in Java, so it’s cross-platform and compatible with any platform that can run the Java Virtual Machine. To use it, just use it in this syntax:

trang.jar <your XML> <your desired XSD>

An example:

trang.jar YourDocument.xml YourSchema.xsd

Viola! You’ll find your XSD automatically generated!

Generate XSD from XML Online

If you don’t want to go through Trang, you can use an online tool. The only online XML to XSD tool that I found was this one: Generate XSD from XML Online

It’s pretty good too, and can give you a quick XSD from your XML document.

Best XML Book for Beginners

If you’re interested in XML and want to learn more about it, I highly recommend this XML book: XML: Visual QuickStart Guide

Have fun! 😀

Similar Posts:

By |2010-05-28T23:55:43+00:00May 27th, 2010|Tutorials & Tips|5 Comments

About the Author:

Alvin Poh lives in Singapore, and is interested in marketing, techy stuff, and likes to just figure out how the two can work with each other. He can also be found on Google+.


  1. Pepe October 3, 2010 at 6:51 am - Reply

    found them too, but theyare not good enough… im' working whit oracle soa suite 11g

  2. Faheem February 15, 2011 at 6:00 pm - Reply

    Or you can use xsd.exe from microsoft 🙂

  3. Nidhi April 7, 2011 at 12:22 am - Reply

    Very cool tool! I used it and it works perfect! Thanks! 🙂

  4. Zed December 4, 2011 at 2:50 am - Reply

    Thank you very much. You saved me couple of hours.

  5. Priya December 29, 2011 at 6:08 am - Reply

    Very good tool. Really it saved my time. Thanks a lot

Leave A Comment