1

I am trying to get my hands on Oraclize, testing some sample queries with their Test query service. I can't get XML parser working with XPath. The documentation lacks an XML example.

Consider this simple feed.

The following query returns Dictionary.com Word of the Day, as expected:

xml(http://www.dictionary.com/wordoftheday/wotd.rss).rss.channel.title

The following semantically equivalent query that uses XPath returns nothing:

xml(http://www.dictionary.com/wordoftheday/wotd.rss).xpath(./rss/channel/title/text())

How can I query an RSS feed with Oraclize and filter the results according to come criteria (e.g., items with <user> field equal to Alice, etc)?

  • But this works: xml(http://www.dictionary.com/wordoftheday/wotd.rss).xpath(//rss/channel/title/text()). Not sure if it helps... – benjaminion Jul 31 '17 at 6:26
1

This is working - specify absolute rather than relative path in the XPath:

xml(http://www.dictionary.com/wordoftheday/wotd.rss).xpath(/rss/channel/title/text())

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.