16.1. Expressing XML Queries
We would like to be able to batch-automate the retrieval of interesting stories from sites such as http://www.slashdot.org. We need some way of crisply expressing what fragments of an XML resource, such as the one above, are of interest to us.
Here is an example query expressed in English.
Find all stories in http://www.slashdot.org/slashdot.xml where:
the title contains the word “Unix” or the word “Linux,” and
the story was published in 1999, and
the story is in the “articles” section.
Here is an XML Query-By-Example search template, interesting.xml, that expresses this query. The idea is to use an XML fragment in which the element type names correspond to the element type names in the searched resource. The contents ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access