From: Bob Hutchison Date: 2006-09-11T21:10:40+09:00 Subject: Re: Feedback on Ruby XML binding/mapping tools? Hi, On Sep 10, 2006, at 12:30 PM, vasudevram wrote: > > Hi group, > > I'd like to hear from anyone who has used any Ruby XML binding/mapping > tools such as xml-mapping, xampl, etc. Pros and cons of such tools, > and > also pros and cons of such tools vs. handwritten code. Warning, xampl is my thing and I'm biased :-) JAXB and xampl take a different approach but operate at a similar 'level'. Xampl is trying to facilitate rapid code development and has a fairly significant runtime library associated with it. You add functionality to xampl object in ruby by re-opening them and adding what you want (or you can arrange for xampl to re-open your classes and add its stuff). You can, but it isn't the plan, to use xampl generated objects as data objects as you are more likely to do in JAXB. Xampl also works from examples of XML documents (hence 'xampl') -- it doesn't work from a schema. When you write code using xampl generated objects you are writing ruby code (or java or common lisp) and there isn't a lot of XMLisms that show up. I am working on a Rails application now that uses xampl instead of ActiveRecord. This means that xampl also handles persistence of its objects (and caching etc). This is absolutely fundamental to xampl. xampl can be used as an alternative to DOM (and it is) but there are other tools that are much more suited to that task (you wouldn't use JAXB for that either I think). I can go on and on about this, and have elsewhere, but probably not in a direction you're interested in. Is there anything specific you wanted to do? or know about xampl? Cheers, Bob > > Working on a project where these might be of use, though not using > them > as of now - already have some code written using just Ruby and REXML. > But might want to replace the hand-rolled code later if any reason is > found for doing so. > > I've done a bit of work with JAXB in Java so I have some idea of the > concepts involved. > > Thanks > Vasudev Ram > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Software training and consulting > http://www.dancingbison.com > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > ---- Bob Hutchison -- blogs at Recursive Design Inc. -- Raconteur -- xampl for Ruby --