Sort by

recency

|

6 Discussions

|

  • + 0 comments

    XPath is an efficient query language that comes in handy when handling structured XML documents. If you work with large volumes of complicated data, you can turn to custom app development dubai to simplify the way you deal with it and add intelligent tools like XPath to your systems. This article did a fantastic job explaining the idea!

  • + 0 comments
    # Standard ruby library for XML parsing
    require 'rexml/document'
    include REXML
    
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    xmlText = "" 
    
    # Read the input XML Fragment
    while line = gets()
    	xmlText += line
    end
    
    doc = Document.new xmlText
    
    # XPath Selector for computing the average popularity of the movies in the given XML fragment.
    # Fill in the blanks to complete the required XPath selector query
    puts XPath.match(doc,"sum(collection/movie/popularity) div count(collection/movie/popularity)")
    
  • + 0 comments

    Here is Querying XML Datastores with XPath - 7 problem solution - https://www.gyangav.com/2022/11/hackerrank-querying-xml-datastores-with-xpath-7-problem-solution.html

  • + 0 comments

    sum(//popularity) div count(//popularity)

  • + 0 comments

    answer:

    puts XPath.match(doc,"sum(collection/movie/popularity) div count(collection/movie/popularity)")