xmlrubydtd

Generating an object model in Ruby from an XML DTD


I have an XML document with a DTD, and would love to be able to access the XML model, something like this:

title = Thing.Items[0].Title

Is there a way, in Ruby, to generate this kind of object model based on a DTD? Or am I stuck using REXML?


Solution

  • You can use the ruby version of xml-simple.

    You shouldn't need to install the gem as I believe it's already installed with rails. http://xml-simple.rubyforge.org/