From: dblack@... Date: 2006-01-15T13:14:24+09:00 Subject: Re: YAML - Time to give? Hi -- On Sun, 15 Jan 2006, thila thila wrote: > Guys- > I am trying to create an YAML file like the following: > 3 > --- Begin > ga: > name: Georgia > capital: savanah > population: 1 mil > cities: > city: > name: Atlanta > zip: 30328 > city: > name: Savanah > zip: 30304 One problem is that you've just redefined the "city" key for this hash. So you'll end up with Savannah but no Atlanta. > I keep getting "parse" error while loading it to yaml. Even if I manage > to load with "-", I could never fetch the City and zip details. Can > anyone help me with this nested yaml file? thanks When I cut-and-pasted your text and did a YAML.load on it, it worked fine (other than the logic error with the "city" key). Do you have a tab character in the file somewhere, instead of leading spaces? Try this and see if it prints 30328: str = <