Can anyone explaing me this line in detail?
// Find all the RSS link elements.
var result = doc.evaluate(
'//*[local-name()="rss" or local-name()="feed" or local-name()="RDF"]',
doc, null, 0, null);
Best Regards,
Cetin
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s doing an XPath query to find if the current document is an RSS feed by checking for the presence of certain XML elements. (Mozilla has a great run-down on XPath in JavaScript here)
Here are some examples:
Take look at the RSS Feed for this question:
It’s looking for that
<feed>element.Or for example the slashdot.org main feed:
It’s looking for that
<rdf:RDF>element.