Mega Code Archive
Categories
/
Ruby
/
XML
Count how many fish are inside the large fish
xml = %{
} require 'rexml/document' doc = REXML::Document.new xml p REXML::XPath.first(doc, "count(//fish[@size='large'][1]//*fish)")