Facets with Eval
✓ Published0🌍 Public
CCliffordAnderson
Last edited Nov 8, 2015
Created on Nov 7, 2015
This example shows dynamic facet generation for a book list, producing ranked categories with value and count attributes for each term. The code applies an external configuration file (`facets.xml`) to a CSV dataset (`books.csv`) using XQuery 3.1, parsing the CSV with the `csv:parse` function and evaluating XPath expressions via `xquery:eval`. It groups books by each facet path, counts them per group, and orders the resulting facet values by frequency in descending order. The visualization relies on standard XQuery functions like `fetch:text`, `fn:doc`, and element constructors, with no external charting libraries involved.
AI-generated description