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:

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+.

5 comments On How To Generate XSD from XML / Convert XML to XSD

Leave a reply:

Your email address will not be published.


Sliding Sidebar