Exercise 20: Querying XML using XPath

Consider the Really Simple Syndication (RSS) feed from rss.cnn.com/rss/cnn topstories.rss below (the content has been shortened to fit the space).

  1. What does the XPath query /rss/channel/item/title return?
  2. What does the XPath query /rss/channel/item[fn:contains(./title, “TSA”)]/title return?
  3. Write an XPath query to find the links to news items of which the description and the title contains “pat-down”.

CNN RSS file