Parsing KML files with REXML?


I’m only getting started with Ruby, and need to edit KML files.

According to this article, it looks like two major tools are available to parse XML files: REXML which is pure Ruby and is included in the Windows package, and Nokogiri which is a gem and thus requires an extra stetp for users (which I’d like to avoid if possible).

Can REXML edit KML files, or is Nokogiri required?

Thank you.

Through googling and trial and error… the answer is yes:

require 'rexml/document'
include REXML

xmlfile ="input.kml")
xmldoc =

  #puts mydocument.elements["name"].text

	  puts mystuff.elements["name"].text

Thanks for the clarification