(Q9) List the titles of books published by Morgan Kaufmann in 1998.
FOR $b IN document("bib.xml")//book
WHERE $b/publisher = "Morgan Kaufmann"
AND $b/year = "1998"
RETURN $b/title
- SQL-like syntax
FOR functions very similarily to xsl:for-each
FOR results in a list of variable bindings, functioning like the current node in XSLT.
WHERE functions exactly like xsl:if
RETURN returns a deep copy of the referenced value(s)
|