View config.xqy
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
xquery version "1.0-ml" ; | |
(: config.xqy | |
This library module holds configuration | |
variables for the application | |
:) | |
module namespace cfg = "http://framework/lib/config"; | |
(: The rewrite library route configuration |
View header.html
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
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<link href='http://fonts.googleapis.com/css?family=Aguafina+Script|Vast+Shadow' rel='stylesheet' type='text/css'/> | |
<link rel="stylesheet" href="/css/mobshake-jm.min.css"/> | |
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0rc2/jquery.mobile.structure-1.0rc2.min.css"/> | |
<link rel="stylesheet" href="/css/mobshake.css" /> | |
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> | |
<script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-1.0rc2.min.js"></script> |
View config-snip.xqy
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
<get path="play/:id/act/:act/scene/:scene/speech/:speech"><to>play#scene</to></get> | |
<get path="search"><to>search#get</to></get> | |
<post path="search"><to>search#get</to></post> |
View circles.xqy
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
xquery version "1.0-ml"; | |
(: a whole bunch of random circles to make the reverse-query harder :) | |
let $n := 10000 | |
for $count in (1 to $n) | |
let $lat := xdmp:random(180) - 90 | |
let $lon := xdmp:random(360) - 180 | |
let $query-doc := | |
View event.xml
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
<?xml version="1.0" encoding="UTF-8"?> | |
<event> | |
<name>Bethesda</name> | |
<point>38.9846520, -77.0947092</point> | |
</event> |
View map.xqy
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
xquery version "1.0-ml"; | |
import module namespace search="http://marklogic.com/appservices/search" | |
at "/MarkLogic/appservices/search/search.xqy"; | |
declare namespace kml = "http://www.opengis.net/kml/2.2"; | |
(:White to red color scale in BBGGRR format :) | |
declare variable $COLOR_SCALE := |
View bookload.xqy
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 := | |
<bookstore> | |
<book category="COOKING"> | |
<title lang="en">Everyday Italian</title> | |
<author>Giada De Laurentiis</author> | |
<year>2005</year> | |
<price>30.00</price> | |
</book> | |
... other books from W3Schools example ... | |
</bookstore> |
View bad.xqy
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
(: I assume local mathematical functions | |
functionA, functionB, and functionC are | |
defined above :) | |
(: this is too procedural :) | |
let $accumulator := 1 | |
let $accumulator := functionA($accumulator) | |
let $accumulator := functionB($accumulator) | |
let $accumulator := functionC($accumulator) | |
return |
View xpath.xqy
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
//book[author eq "J K. Rowling"] |
View enrich.xqy
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
xquery version "1.0-ml"; | |
for $character in ("Frodo", "Sam", "Merry", "Pippin", "Boromir", "Gimli", "Legolas", "Aragorn", "Gandalf") | |
return | |
xdmp:eval(' | |
xquery version"1.0-ml"; | |
declare variable $character as xs:string external; | |
for $line in cts:search(/line-doc, $character) | |
return | |
xdmp:node-replace( |
OlderNewer