Purpose: A functional query language designed to query and manipulate XML data.
Use Case: Can retrieve, transform, and aggregate data from XML documents.
Syntax: Combines elements of functional programming with SQL-like query capabilities.
Example:
xquery
for $book in doc("books.xml")/library/book
return <title>{ $book/title/text() }</title>
Summary of Differences
CSS is for styling HTML, XPath is for navigating XML data, XSLT is for transforming XML documents, and XQuery is for querying and manipulating XML data.
CSS and XSLT are primarily concerned with presentation, while XPath and XQuery focus on data retrieval and manipulation.