Sort by

recency

|

9 Discussions

|

  • + 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 picking up the shelf of the movie named 'Transformers'
    # Fill in the blanks to complete the required XPath selector query
    # Assume there is only ONE such movie.
    puts doc.elements["collection/movie[@title='Transformers']/@shelf"]
    
  • + 0 comments

    ["collection/movie[@title='Transformers']/@shelf"]

  • + 0 comments

    i dont understand this topic plzz any one could help me through this or is there any youtube videos through which i can understand

  • + 0 comments

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

  • + 0 comments
    puts doc.elements["collection/movie[@title = 'Transformers']/@shelf"]