Filtering with where clauses
✓ Published0🌍 Public
CCliffordAnderson
Last edited Jul 28, 2017
Created on Jul 28, 2017
This example shows a simple XML data filter that selects only fiction books from a hardcoded set and returns them sorted alphabetically. It uses the XQuery language, specifically the `where` clause to exclude items with a `class` attribute value of "nonfiction", and the `order by` clause to sort the remaining books by their text content. The query processes an inline `<books>` element containing five `<book>` entries, each with a `class` attribute, and returns the filtered, ordered book titles.
AI-generated description