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.
Querying XML Datastores with XPath - 1
Querying XML Datastores with XPath - 1
Sort by
recency
|
8 Discussions
|
Please Login in order to post a comment
Here is Querying XML Datastores with XPath - 1 problem solution - https://www.gyangav.com/2022/11/hackerrank-querying-xml-datastores-with-xpath-1-problem-solution.html
puts doc.elements.each("collection/movie/@title")
//collection/movie/data(@title)
Answer:
require 'rexml/document' include REXML xmlText = "movies.xml"
while line = gets() xmlText += line end
doc = Document.new xmlText puts doc.elements.each("collection/movie/@title")