From: Henrik Martensson Date: 2006-02-24T07:59:28+09:00 Subject: Re: Creating Ruby Classes from XSD? On Thu, 2006-02-23 at 18:32, Logan Capaldo wrote: > Ok, I'm going to be honest and say first I've never had occasion to > use this tool. But I'm wondering what exactly is the point? Ruby's > syntax is much less verbose than XML. > Why would you want to type this: > When you can do one of these: > I may have mangled some of the XSD, I'm admitedly not familiar with > it, but generating classes froma schema seems rife with problems > The basic idea is that if you have a schema specification, you can generate classes for whatever language you want, and the applications that use them will all understand the same data formats. Unfortunately, the idea is flawed. You are quite right. There isn't much of a point. Building classes directly from a data format specification makes the application using the classes tightly coupled to the data format. In most cases it is better to work with a generic XML parsing API, wether it is REXML, DOM, SAX, or something else. It makes it a lot easier to write robust applications. I have worked with SGML/XML for a long time. I like XML, but not for everything. One of the things that attracted me to Ruby is that it has to a large part escaped the "XML for everything" craze that permeats Java, and to some extent .NET. /Henrik -- http://kallokain.blogspot.com/ - Blogging from the trenches of software development http://www.henrikmartensson.org/ - Reflections on software development http://testunitxml.rubyforge.org/ - The Test::Unit::XML Home Page http://declan.rubyforge.org/ - The Declan Home Page