-
-
Save baskaufs/dadb1e3012a5bf2147a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let $books := | |
<books> | |
<book class="fiction">Book of Strange New Things</book> | |
<book class="nonfiction">Programming Scala</book> | |
<book class="fiction">Absurdistan</book> | |
<book class="nonfiction">Art of R Programming</book> | |
<book class="fiction">I, Robot</book> | |
</books> | |
for $book in $books/book | |
let $title := $book/text()||" " | |
let $class := " "||$book/@class||" " | |
order by $title | |
group by $class | |
return ($class, $title) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment