From: Cean Ooi Date: 2008-06-02T15:30:13+09:00 Subject: Re: Parse XML to database hmm....i solved the database problem.. but... after i extract the xml file, it shows me nil which part that i did wrong? require 'rexml/document' require "mysql" require "dbi" include REXML scanfile = File.new('River_Va.lmx') dbname="email_development" doc = REXML::Document.new scanfile string = < Text, text, text EOF doc = Document.new string doc = Document.new File.new("River_Va.lmx") doc.elements.each("lm:landmarkCollection/lm:landmark") { |element| puts element.attributes["lm:name"] } root = doc.root popo = root.attributes["lm:name"] puts root.attributes["lm:name"] -- Posted via http://www.ruby-forum.com/.