Skip to content

Instantly share code, notes, and snippets.

@baskaufs
Forked from CliffordAnderson/example.xqy
Last active August 29, 2015 14:15

Revisions

  1. Steve Baskauf revised this gist Feb 19, 2015. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions example.xqy
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    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>
    <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
    let $title := $book/text()||"&#10;"
    let $class := "&#10;"||$book/@class||"&#10;"
    order by $title
    group by $class
    return ($class, $title)
    return ($class, $title)
  2. @CliffordAnderson CliffordAnderson created this gist Feb 18, 2015.
    14 changes: 14 additions & 0 deletions example.xqy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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)