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

    Write the XPath selector for finding the number of characters (i.e, the string-length) in the description of the second movie in the XML file.

    Fill in the blanks to complete the required XPath selector query

    description = doc.elements["/collection/movie[2]/description"].text puts description.length

  • + 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
    
    # Write the XPath selector for finding the number of characters (i.e, the string-length) in the description of the second movie in the XML file.
    # Fill in the blanks to complete the required XPath selector query
    puts doc.elements.each("string-length(collection/movie[2]/description)")
    
  • + 0 comments

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

  • + 0 comments

    puts doc.elements.each("string-length(collection/movie[2]/description)")

  • + 0 comments

    Querying XML datastores with some of those code which are simple. Other readers stay away from my material, Because it is only for those understand trust my paper of coding. Instead of programmers no one understand it but you can tell me about my blog data.