We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
require 'rexml/document'
include REXML
xmlText = ""
while line = gets()
xmlText += line
end
doc = Document.new xmlTextpopularity<8, in the same order as which they occur in the given XML. query
puts doc.elements.each("collection/movie[popularity/text() < 8]/format/text()")
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Querying XML Datastores with XPath - 3
You are viewing a single comment's thread. Return to all comments →
require 'rexml/document' include REXML xmlText = "" while line = gets() xmlText += line end doc = Document.new xmlTextpopularity<8, in the same order as which they occur in the given XML. query puts doc.elements.each("collection/movie[popularity/text() < 8]/format/text()")