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.
# Standard ruby library for XML parsingrequire'rexml/document'includeREXML# Enter your code here. Read input from STDIN. Print output to STDOUTxmlText=""# Read the input XML Fragmentwhileline=gets()xmlText+=lineenddoc=Document.newxmlText# 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 queryputsdoc.elements.each("string-length(collection/movie[2]/description)")
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Querying XML Datastores with XPath - 8
You are viewing a single comment's thread. Return to all comments →