From: Patrick Aljord Date: 2007-04-29T01:43:12+09:00 Subject: need help to parse xml (foaf) hey all, I have a foaf.xml that looks like that: myself myself 67b60b91fd6d4f68e32deae93956d36bc7c93c70 bob bill I put all this into a string @f and then I create a doc: doc=Document.new(@f.body) @foaffriends=doc.root I'm trying to get the names of all my friends: "bill" and "bob" If I do: @foaffriends[1].elements['foaf:knows'][1].elements['foaf:name'] I get "bob" but I can't figure out how to get "bill". I tried: @foaffriends[1].elements['foaf:knows'][2].elements['foaf:name'] but it returned nil. Any idea how to get all my friends name? thanx in advance Pat