Mega Code Archive
Categories
/
Ruby
/
XML
Get XPath from node
xml = %{
} require 'rexml/document' doc = REXML::Document.new xml p red_fish = doc.children[0] p red_fish.xpath p REXML::XPath.first(doc, red_fish.xpath)