CodeMirror: XQuery mode

 
1
 
2
xquery version "1.0-ml";
3
(: this is
4
 : a 
5
   "comment" :)
6
let $let := <x attr="value">"test"<func>function() $var {function()} {$var}</func></x>
7
let $joe:=1
8
return element element {
9
    attribute attribute { 1 },
10
    element test { 'a' }, 
11
    attribute foo { "bar" },
12
    fn:doc()[ foo/@bar eq $let ],
13
    //x }    
14
 
15
(: a more 'evil' test :)
16
(: Modified Blakeley example (: with nested comment :) ... :)
17
declare private function local:declare() {()};
18
declare private function local:private() {()};
19
declare private function local:function() {()};
20
declare private function local:local() {()};
21
let $let := <let>let $let := "let"</let>
22
return element element {
23
    attribute attribute { try { xdmp:version() } catch($e) { xdmp:log($e) } },
24
    attribute fn:doc { "bar" castable as xs:string },
25
    element text { text { "text" } },
26
    fn:doc()[ child::eq/(@bar | attribute::attribute) eq $let ],
27
    //fn:doc
28
}
29
 
30
 
31
 
32
xquery version "1.0-ml";
33
 
34
(: Copyright 2006-2010 Mark Logic Corporation. :)
35
 
36
(:
 

MIME types defined: application/xquery.

Development of the CodeMirror XQuery mode was sponsored by MarkLogic and developed by Mike Brevoort.