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.newxmlTextundefined# Write the XPath selector for listing the title of the second movie for which the marked shelf = "B".# Fill in the blanks to complete the required XPath selector
Try this coding it's working fine you can check here mohamadia.com.sa
Querying XML Datastores with XPath - 3
You are viewing a single comment's thread. Return to all comments →
Try this coding it's working fine you can check here mohamadia.com.sa
query puts doc.elements.each("collection/movie[@shelf = 'B'][2]/@title") `