Sort by

recency

|

9 Discussions

|

  • + 0 comments

    For beginners starting with querying XML datastores, focusing on foundational XPath concepts such as node selection (/, //), filtering with predicates ([ ]), and function use (text(), contains()) will be crucial. Mastery of these will provide a solid base to tackle more complex queries efficiently. Aura444 Login

  • + 0 comments

    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

  • + 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 = "movies.xml" 
    
    # Read the input XML Fragment
    while line = gets()
    	xmlText += line
    end
    
    doc = Document.new xmlText
    
    # XPath Selector for listing the titles of the movies, in the same order as which they occur in the given XML.
    # Fill in the blanks to complete the required XPath selector query
    puts doc.elements.each("collection/movie/@title")
    
  • + 0 comments

    puts doc.elements.each("collection/movie/@title")

  • + 0 comments

    //collection/movie/data(@title)