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 - 2
Querying XML Datastores with XPath - 2
Sort by
recency
|
8 Discussions
|
Please Login in order to post a comment
XPath 2.0 introduces enhanced functionalities compared to XPath 1.0, including improved data typing, richer functions, and better support for complex queries. Tigerexchange 247.com login
require 'rexml/document' include REXML
xmlText = "movies.xml"
while line = gets() xmlText += line end
doc = Document.new xmlText
puts doc.elements.each("collection/movie//popularity/text()")
require 'rexml/document' include REXML
xml_data = < War, Thriller DVD 2001 PG 10 Talk about a war Science Fiction DVD 1980 R 7 Science Fiction Action DVD 4 PG 10 Quite a bit of action! Comedy VHS PG 2 Boring EOF
Case 0 is ok but case 1 is wrong, any idea ?? about how can i solve it :I doc = Document.new(xml_data) doc.elements.each("collection/movie/popularity") do |ele| puts ele.text end
Here is Querying XML Datastores with XPath - 2 problem solution - https://www.gyangav.com/2022/11/hackerrank-querying-xml-datastores-with-xpath-2-problem-solution.html