how to read XML with ruby -


Is there any way to read XML with Ruby and get properties easily? what might happen? & lt; People & gt; & Lt; John ID = 1 & gt; & Lt; / John & gt; & Lt; My id = 2 & gt; & Lt; / My & gt; & Lt; / People & gt;

I want to see Mary or Johns ID. (John ['id']?)

Try / code / Sample code from

Xmlfile) # Now root element root = xmldoc.root puts "root element:" + root.attributes ["shelf"] # All this movie titles will be produced Xmldoc.elements.each ("archive / movie") {| E Puts "movie title:" + e.attributes ["title"]}

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -