I'm new to Ruby and need to write some code to parse a variable length XML structure like the one below. In the below case, the <port> time can occur a variable number of times. I want to store each one of these port numbers into a separate database record.
Also, is there anyway for Rails to automatically insert these into a relational set of models. For instance, the Address record would contain the 'host' and then a many to many relationship to a bunch of port numbers. Are there any features or libraries to make this mapping easier when parsing?
Thanks Chirag
<address> <host>example.org</host> <port>1234</port> <port> 5678</port> ... <port> 6789</port> </address>