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

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -