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.
These results seem to be tests of Ruby rather than of just XPath. In particular, it seems that Ruby does not automatically take the value of the node returned when attempting to print it, so you have to use text() or number. Contrast with Xpath internally, where the value of an element node is the concatenation of all text anwhere under it. So in order to get the correct answer, you have to put in parts that are not required by Xpath but are required by Ruby puts.
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 - 2
You are viewing a single comment's thread. Return to all comments →
These results seem to be tests of Ruby rather than of just XPath. In particular, it seems that Ruby does not automatically take the value of the node returned when attempting to print it, so you have to use text() or number. Contrast with Xpath internally, where the value of an element node is the concatenation of all text anwhere under it. So in order to get the correct answer, you have to put in parts that are not required by Xpath but are required by Ruby puts.