summaryrefslogtreecommitdiff
path: root/tests/lexers/xquery
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lexers/xquery')
-rw-r--r--tests/lexers/xquery/example.txt850
-rw-r--r--tests/lexers/xquery/example2.txt2294
-rw-r--r--tests/lexers/xquery/example3.txt1902
3 files changed, 5046 insertions, 0 deletions
diff --git a/tests/lexers/xquery/example.txt b/tests/lexers/xquery/example.txt
new file mode 100644
index 00000000..01593911
--- /dev/null
+++ b/tests/lexers/xquery/example.txt
@@ -0,0 +1,850 @@
+---input---
+xquery version "3.0";
+
+declare function local:add-log-message($message as xs:string) as empty-sequence()?
+{
+ let $logfile-collection := "/db/apps/exist101/log"
+ let $logfile-name := "exist101-log.xml"
+ let $logfile-full := concat($logfile-collection, '/', $logfile-name)
+ let $logfile-created :=
+ if(doc-available($logfile-full))then
+ $logfile-full
+ else
+ xmldb:store($logfile-collection, $logfile-name, <eXist101-Log/>)
+ return
+ update insert
+ <LogEntry timestamp="{current-dateTime()}">{$message}</LogEntry>
+ into doc($logfile-full)/*
+};
+
+declare function local:insert-attributes() {
+ let $elm as element() := doc('/db/Path/To/Some/Document.xml')/*
+ return (
+ update insert <NEW/> into $elm,
+ update insert attribute x { 'y' } into $elm/*[last()],
+ update insert attribute a { 'b' } into $elm/*[last()]
+ )
+};
+
+declare function local:insert-elem() {
+ let $elm as element() := doc('/db/Path/To/Some/Document.xml')/*
+ return
+ update insert <NEW x="y" a="b"/> into $elm
+};
+
+declare function local:insert-elem2() {
+ let $elm as element() := doc('/db/Path/To/Some/Document.xml')/*
+ let $new-element as element() := <NEW x="y" a="b"/>
+ return
+ update insert $new-element into $elm
+};
+
+declare function local:insert-single() {
+ update insert <LogEntry>Something happened...</LogEntry> into doc('/db/logs/mainlog.xml')/*
+};
+
+
+declare function local:trim-insert() {
+ let $document := doc('/db/logs/mainlog.xml')
+ let $newentry := <LogEntry>Something happened...</LogEntry>
+ return
+ update delete $document/*/LogEntry[position() ge 10],
+ if(exists($document/*/LogEntry[1]))then
+ update insert $newentry preceding $document/*/LogEntry[1]
+ else
+ update insert $newentry into $document/*
+};
+
+
+declare function local:attempt-document-node-insert() {
+
+ (: This is invalid: :)
+ let $document as document-node() := <Root><a/></Root>
+ return
+ update insert <b/> into $document/*
+};
+
+declare function local:attempt-attr-update-with-node() {
+ update replace doc('/db/test/test.xml')/*/@name with
+ <a>aaa<b>bbb</b></a>
+};
+
+
+(# exist:batch-transaction #) {
+ update delete $document/*/LogEntry[position() ge 10],
+ update insert $newentry preceding $document/*/LogEntry[1]
+}
+
+---tokens---
+'xquery' Keyword.Pseudo
+' ' Text
+'version' Keyword.Pseudo
+' ' Text
+'"3.0"' Literal.String.Double
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:add-log-message' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'message' Name
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'empty-sequence' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+'?' Punctuation
+'\n' Text
+
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'logfile-collection' Name
+' ' Text
+':=' Operator
+' ' Text
+'"/db/apps/exist101/log"' Literal.String.Double
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'logfile-name' Name
+' ' Text
+':=' Operator
+' ' Text
+'"exist101-log.xml"' Literal.String.Double
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'logfile-full' Name
+' ' Text
+':=' Operator
+' ' Text
+'concat' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'logfile-collection' Name
+',' Punctuation
+' ' Text
+"'/'" Literal.String.Single
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'logfile-name' Name
+')' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'logfile-created' Name
+' ' Text
+':=' Operator
+'\n\t' Text
+'if' Keyword
+'(' Punctuation
+'doc-available' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'logfile-full' Name
+')' Punctuation
+')' Punctuation
+'then' Keyword
+'\n\t\t' Text
+'$' Name.Variable
+'logfile-full' Name
+'\n\t' Text
+'else' Keyword
+'\n\t\t' Text
+'xmldb:store' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'logfile-collection' Name
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'logfile-name' Name
+',' Punctuation
+' ' Text
+'<' Name.Tag
+'eXist101-Log' Name.Tag
+'/>' Name.Tag
+')' Punctuation
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+'\n\t\t\t' Text
+'<' Name.Tag
+'LogEntry' Name.Tag
+' ' Text
+'timestamp' Name.Tag
+'=' Operator
+'"' Punctuation
+'{' Punctuation
+'current-dateTime' Name.Function
+'(' Punctuation
+')' Punctuation
+'}' Punctuation
+'"' Punctuation
+'>' Name.Tag
+'{' Punctuation
+'$' Name.Variable
+'message' Name
+'}' Punctuation
+'</' Name.Tag
+'LogEntry' Name.Tag
+'>' Name.Tag
+'\n\t\t' Text
+'into' Keyword
+' ' Text
+'doc' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'logfile-full' Name
+')' Punctuation
+'/' Punctuation
+'*' Name.Tag
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:insert-attributes' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'elm' Name
+' ' Text
+'as' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+' ' Text
+':=' Operator
+' ' Text
+'doc' Name.Function
+'(' Punctuation
+"'/db/Path/To/Some/Document.xml'" Literal.String.Single
+')' Punctuation
+'/' Punctuation
+'*' Name.Tag
+'\n\t' Text
+'return' Keyword
+' ' Text
+'(' Punctuation
+'\n\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'<' Name.Tag
+'NEW' Name.Tag
+'/>' Name.Tag
+' ' Text
+'into' Keyword
+' ' Text
+'$' Name.Variable
+'elm' Name
+',' Punctuation
+'\n\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'attribute' Keyword
+' ' Text
+'x' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+"'y'" Literal.String.Single
+' ' Text
+'}' Punctuation
+' ' Text
+'into' Keyword
+' ' Text
+'$' Name.Variable
+'elm' Name
+'/' Punctuation
+'*' Name.Tag
+'[' Punctuation
+'last' Name.Function
+'(' Punctuation
+')' Punctuation
+']' Punctuation
+',' Punctuation
+'\n\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'attribute' Keyword
+' ' Text
+'a' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+"'b'" Literal.String.Single
+' ' Text
+'}' Punctuation
+' ' Text
+'into' Keyword
+' ' Text
+'$' Name.Variable
+'elm' Name
+'/' Punctuation
+'*' Name.Tag
+'[' Punctuation
+'last' Name.Function
+'(' Punctuation
+')' Punctuation
+']' Punctuation
+'\n\t' Text
+')' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:insert-elem' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'elm' Name
+' ' Text
+'as' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+' ' Text
+':=' Operator
+' ' Text
+'doc' Name.Function
+'(' Punctuation
+"'/db/Path/To/Some/Document.xml'" Literal.String.Single
+')' Punctuation
+'/' Punctuation
+'*' Name.Tag
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'<' Name.Tag
+'NEW' Name.Tag
+' ' Text
+'x' Name.Tag
+'=' Operator
+'"' Punctuation
+'y' Name.Attribute
+'"' Punctuation
+' ' Text
+'a' Name.Tag
+'=' Operator
+'"' Punctuation
+'b' Name.Attribute
+'"' Punctuation
+'/>' Name.Tag
+' ' Text
+'into' Keyword
+' ' Text
+'$' Name.Variable
+'elm' Name
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:insert-elem2' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'elm' Name
+' ' Text
+'as' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+' ' Text
+':=' Operator
+' ' Text
+'doc' Name.Function
+'(' Punctuation
+"'/db/Path/To/Some/Document.xml'" Literal.String.Single
+')' Punctuation
+'/' Punctuation
+'*' Name.Tag
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'new-element' Name
+' ' Text
+'as' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+' ' Text
+':=' Operator
+' ' Text
+'<' Name.Tag
+'NEW' Name.Tag
+' ' Text
+'x' Name.Tag
+'=' Operator
+'"' Punctuation
+'y' Name.Attribute
+'"' Punctuation
+' ' Text
+'a' Name.Tag
+'=' Operator
+'"' Punctuation
+'b' Name.Attribute
+'"' Punctuation
+'/>' Name.Tag
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'$' Name.Variable
+'new-element' Name
+' ' Text
+'into' Keyword
+' ' Text
+'$' Name.Variable
+'elm' Name
+'\t\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:insert-single' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'<' Name.Tag
+'LogEntry' Name.Tag
+'>' Name.Tag
+'S' Literal
+'o' Literal
+'m' Literal
+'e' Literal
+'t' Literal
+'h' Literal
+'i' Literal
+'n' Literal
+'g' Literal
+' ' Literal
+'h' Literal
+'a' Literal
+'p' Literal
+'p' Literal
+'e' Literal
+'n' Literal
+'e' Literal
+'d' Literal
+'.' Literal
+'.' Literal
+'.' Literal
+'</' Name.Tag
+'LogEntry' Name.Tag
+'>' Name.Tag
+' ' Text
+'into' Keyword
+' ' Text
+'doc' Name.Function
+'(' Punctuation
+"'/db/logs/mainlog.xml'" Literal.String.Single
+')' Punctuation
+'/' Punctuation
+'*' Name.Tag
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:trim-insert' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'document' Name
+' ' Text
+':=' Operator
+' ' Text
+'doc' Name.Function
+'(' Punctuation
+"'/db/logs/mainlog.xml'" Literal.String.Single
+')' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'newentry' Name
+' ' Text
+':=' Operator
+' ' Text
+'<' Name.Tag
+'LogEntry' Name.Tag
+'>' Name.Tag
+'S' Literal
+'o' Literal
+'m' Literal
+'e' Literal
+'t' Literal
+'h' Literal
+'i' Literal
+'n' Literal
+'g' Literal
+' ' Literal
+'h' Literal
+'a' Literal
+'p' Literal
+'p' Literal
+'e' Literal
+'n' Literal
+'e' Literal
+'d' Literal
+'.' Literal
+'.' Literal
+'.' Literal
+'</' Name.Tag
+'LogEntry' Name.Tag
+'>' Name.Tag
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'update' Keyword
+' ' Text
+'delete' Keyword
+' ' Text
+'$' Name.Variable
+'document' Name
+'/' Punctuation
+'*' Name.Tag
+'/' Punctuation
+'LogEntry' Name.Tag
+'[' Punctuation
+'position' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'ge' Operator.Word
+' ' Text
+'10' Literal.Number.Integer
+']' Punctuation
+',' Punctuation
+'\n\t\t' Text
+'if' Keyword
+'(' Punctuation
+'exists' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'document' Name
+'/' Punctuation
+'*' Name.Tag
+'/' Punctuation
+'LogEntry' Name.Tag
+'[' Punctuation
+'1' Literal.Number.Integer
+']' Punctuation
+')' Punctuation
+')' Punctuation
+'then' Keyword
+'\n\t\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'$' Name.Variable
+'newentry' Name
+' ' Text
+'preceding' Keyword
+' ' Text
+'$' Name.Variable
+'document' Name
+'/' Punctuation
+'*' Name.Tag
+'/' Punctuation
+'LogEntry' Name.Tag
+'[' Punctuation
+'1' Literal.Number.Integer
+']' Punctuation
+'\n\t\t' Text
+'else' Keyword
+'\n\t\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'$' Name.Variable
+'newentry' Name
+' ' Text
+'into' Keyword
+' ' Text
+'$' Name.Variable
+'document' Name
+'/' Punctuation
+'*' Name.Tag
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:attempt-document-node-insert' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t\n\t' Text
+'(:' Comment
+' ' Comment
+'T' Comment
+'h' Comment
+'i' Comment
+'s' Comment
+' ' Comment
+'i' Comment
+'s' Comment
+' ' Comment
+'i' Comment
+'n' Comment
+'v' Comment
+'a' Comment
+'l' Comment
+'i' Comment
+'d' Comment
+':' Comment
+' ' Comment
+':)' Comment
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'document' Name
+' ' Text
+'as' Keyword
+' ' Text
+'document-node' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+' ' Text
+':=' Operator
+' ' Text
+'<' Name.Tag
+'Root' Name.Tag
+'>' Name.Tag
+'<' Name.Tag
+'a' Name.Tag
+'/>' Name.Tag
+'</' Name.Tag
+'Root' Name.Tag
+'>' Name.Tag
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'<' Name.Tag
+'b' Name.Tag
+'/>' Name.Tag
+' ' Text
+'into' Keyword
+' ' Text
+'$' Name.Variable
+'document' Name
+'/' Punctuation
+'*' Name.Tag
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:attempt-attr-update-with-node' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'update' Keyword
+' ' Text
+'replace' Keyword
+' ' Text
+'doc' Name.Function
+'(' Punctuation
+"'/db/test/test.xml'" Literal.String.Single
+')' Punctuation
+'/' Punctuation
+'*' Name.Tag
+'/' Punctuation
+'@name' Name.Attribute
+' ' Text
+'with' Keyword
+'\n\t\t' Text
+'<' Name.Tag
+'a' Name.Tag
+'>' Name.Tag
+'a' Literal
+'a' Literal
+'a' Literal
+'<' Name.Tag
+'b' Name.Tag
+'>' Name.Tag
+'b' Literal
+'b' Literal
+'b' Literal
+'</' Name.Tag
+'b' Name.Tag
+'>' Name.Tag
+'</' Name.Tag
+'a' Name.Tag
+'>' Name.Tag
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n\n' Text
+
+'(#' Punctuation
+' ' Text
+'exist:batch-transaction' Name.Variable
+' ' Literal
+'#)' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'update' Keyword
+' ' Text
+'delete' Keyword
+' ' Text
+'$' Name.Variable
+'document' Name
+'/' Punctuation
+'*' Name.Tag
+'/' Punctuation
+'LogEntry' Name.Tag
+'[' Punctuation
+'position' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'ge' Operator.Word
+' ' Text
+'10' Literal.Number.Integer
+']' Punctuation
+',' Punctuation
+'\n\t' Text
+'update' Keyword
+' ' Text
+'insert' Keyword
+' ' Text
+'$' Name.Variable
+'newentry' Name
+' ' Text
+'preceding' Keyword
+' ' Text
+'$' Name.Variable
+'document' Name
+'/' Punctuation
+'*' Name.Tag
+'/' Punctuation
+'LogEntry' Name.Tag
+'[' Punctuation
+'1' Literal.Number.Integer
+']' Punctuation
+'\n' Text
+
+'}' Punctuation
+'\n' Text
diff --git a/tests/lexers/xquery/example2.txt b/tests/lexers/xquery/example2.txt
new file mode 100644
index 00000000..135b92a5
--- /dev/null
+++ b/tests/lexers/xquery/example2.txt
@@ -0,0 +1,2294 @@
+---input---
+xquery version "3.0";
+
+declare namespace other = "http://other";
+
+declare variable $local:straight-var1 := 'one';
+
+declare %private variable $local:private-var := 'secret';
+declare %public variable $local:public-var := 'not-secret';
+declare %other:annotation('param1', "param2") variable $local:some-var := 'anything';
+
+declare variable $local:straight-var2 := 'two';
+
+
+(: Simple Map Operator example :)
+declare function local:word-count($elms as element()*) as xs:integer {
+ sum($elms ! count(tokenize(., '\s+')))
+};
+
+declare function local:add($a, $b) {
+ $a + $b
+};
+
+declare function local:dispatch($node as node()) as item()* {
+ typeswitch($node)
+ case text() return $node
+ case comment() return $node
+ case element(bill) return local:bill($node)
+ case element(btitle) return local:btitle($node)
+ case element(section-id) return local:section-id($node)
+ case element(bill-text) return local:bill-text($node)
+ case element(strike) return local:strike($node)
+ default return local:passthru($node)
+};
+
+(: `switch` expression example :)
+declare function local:noise($animal) {
+ let $duck := "Duck",
+ $quack := "Quack"
+ return
+ switch ($animal)
+ case "Cow" return "Moo"
+ case 'Cat' return 'Meow'
+ case $duck return $quack
+ default return "What's that odd noise?"
+};
+
+(: `group by` expression with binding example :)
+declare function local:a-to-z() {
+ let $data as element()* := (
+ <item>Apples</item>,
+ <item>Bananas</item>,
+ <item>Apricots</item>,
+ <item>Pears</item>,
+ <item>Brambles</item>
+ ) return
+ <GroupedItems>{
+ for $item in $data
+ group by $key := upper-case(substring($item, 1, 1))
+ order by $key
+ return
+ <Group key="{$key}">{$item}</Group>
+ }</GroupedItems>
+};
+
+(: `group by` expression example :)
+declare function local:plays-by-character() {
+ let $plays := (
+ document {
+ <play>
+ <title>Hamlet</title>
+ <characters>
+ <character>Hamlet</character>
+ <character>Claudius</character>
+ <character>Polonius</character>
+ <character>Rosencrantz</character>
+ <character>Guildenstern</character>
+ <character>Francisco</character>
+ <character>Reynaldo</character>
+ </characters>
+ </play>
+ },
+ document {
+ <play>
+ <title>Rosenkrantz and Guildenstern are Dead</title>
+ <characters>
+ <character>Alfred</character>
+ <character>Rosencrantz</character>
+ <character>Guildenstern</character>
+ <character>Hamlet</character>
+ <character>Claudius</character>
+ </characters>
+ </play>
+ }
+ ) return
+
+ for $play in $plays/play
+ let $title := $play/title
+ for $character in $play/characters/character
+ group by $character
+ return
+ <character name="{$character}">
+ {
+ $title ! <play>{ . }</play>
+ }
+ </character>
+};
+
+declare
+ %other:a
+ %private
+ %other:b('1')
+ %other:c("1", "2", "3", "4")
+function local:very-annotated() {
+ let $thing := "thing"
+ return
+ $thing
+};
+
+declare %public function local:slightly-annotated() {
+ let $nothing := ()
+ return
+ $nothing
+};
+
+declare function local:ordered() {
+ for $hit in doc("/db/doc-with-indexes.xml")//tei:p[other:query(., $search-expression)]
+ let $score as xs:float := other:score($hit)
+ order by $score descending
+ return (
+ <p>Score: {$score}:</p>,
+ other:summarize($hit, <config width="40"/>)
+ )
+};
+
+declare function local:concat-expr($postfix) {
+
+ let $concatenated := other:uri() || "/" || $postfix
+ return
+ $concatenated
+};
+
+declare function local:human-units($bytes) {
+ let $unit := if($bytes > math:pow(1024, 3)) then
+ (math:pow(1024, 3), "GB")
+ else if($bytes > math:pow(1024, 2)) then
+ (math:pow(1024, 2), "MB")
+ else
+ (1024, "KB")
+ return
+ format-number($bytes div $unit[1], ".00") || " " || $unit[2]
+};
+
+declare function local:merge-simple($a as xs:string+, $b as xs:string+) as xs:string+ {
+ ($a, $b)
+};
+
+(: higher order function example 1 :)
+declare function local:apply($func, $value) {
+ $func($value)
+};
+
+(: higher order function example 2 :)
+declare function local:apply-all($func, $list) {
+ $list ! $func(.)
+};
+
+(: higher order function example 3 :)
+declare function local:apply-all-long($func as function(xs:string) as xs:string, $list) {
+ $list ! $func(.)
+};
+
+(: higher order function example 4 :)
+declare function local:merge($func as function(xs:string+, xs:string+) as xs:string+, $a as xs:string+, $b as xs:string+) as xs:string+ {
+ $func($a, $b)
+};
+
+let $to-upper := upper-case#1
+let $to-upper-long as function(xs:string) as xs:string := upper-case#1
+return
+ <case>
+ {
+ local:apply-all($to-upper, ("Hello", "world!")) ! <upper>{.}</upper>,
+ local:apply-all-long(lower-case#1, ("Hello", "world!")) ! <lower>{.}</lower>
+ }
+ </case>
+
+---tokens---
+'xquery' Keyword.Pseudo
+' ' Text
+'version' Keyword.Pseudo
+' ' Text
+'"3.0"' Literal.String.Double
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'namespace' Keyword.Declaration
+' ' Text
+'other' Name.Namespace
+' ' Text
+'=' Operator
+' ' Text
+'"http://other"' Literal.String.Double
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'variable' Keyword.Declaration
+' ' Text
+'$' Name.Variable
+'local:straight-var1' Name
+' ' Text
+':=' Operator
+' ' Text
+"'one'" Literal.String.Single
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'%' Name.Decorator
+'private' Name.Decorator
+' ' Text
+'variable' Keyword.Declaration
+' ' Text
+'$' Name.Variable
+'local:private-var' Name
+' ' Text
+':=' Operator
+' ' Text
+"'secret'" Literal.String.Single
+';' Punctuation
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'%' Name.Decorator
+'public' Name.Decorator
+' ' Text
+'variable' Keyword.Declaration
+' ' Text
+'$' Name.Variable
+'local:public-var' Name
+' ' Text
+':=' Operator
+' ' Text
+"'not-secret'" Literal.String.Single
+';' Punctuation
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'%' Name.Decorator
+'other:annotation' Name.Decorator
+'(' Punctuation
+"'param1'" Literal.String.Single
+',' Punctuation
+' ' Text
+'"param2"' Literal.String.Double
+')' Punctuation
+' ' Text
+'variable' Keyword.Declaration
+' ' Text
+'$' Name.Variable
+'local:some-var' Name
+' ' Text
+':=' Operator
+' ' Text
+"'anything'" Literal.String.Single
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'variable' Keyword.Declaration
+' ' Text
+'$' Name.Variable
+'local:straight-var2' Name
+' ' Text
+':=' Operator
+' ' Text
+"'two'" Literal.String.Single
+';' Punctuation
+'\n\n\n' Text
+
+'(:' Comment
+' ' Comment
+'S' Comment
+'i' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+'M' Comment
+'a' Comment
+'p' Comment
+' ' Comment
+'O' Comment
+'p' Comment
+'e' Comment
+'r' Comment
+'a' Comment
+'t' Comment
+'o' Comment
+'r' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'a' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+':)' Comment
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:word-count' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'elms' Name
+' ' Text
+'as' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+'*' Punctuation
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'xs:integer' Keyword.Type
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'sum' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'elms' Name
+' ' Text
+'!' Operator
+' ' Text
+'count' Name.Function
+'(' Punctuation
+'tokenize' Name.Function
+'(' Punctuation
+'.' Punctuation
+',' Punctuation
+' ' Text
+"'\\s+'" Literal.String.Single
+')' Punctuation
+')' Punctuation
+')' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:add' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'a' Name
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'b' Name
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'$' Name.Variable
+'a' Name
+' ' Text
+'+' Operator
+' ' Text
+'$' Name.Variable
+'b' Name
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:dispatch' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'node' Name
+' ' Text
+'as' Keyword
+' ' Text
+'node' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'item' Keyword
+'(' Punctuation
+')' Punctuation
+'*' Operator
+' ' Text
+'{' Punctuation
+'\n ' Text
+'typeswitch' Keyword
+'(' Punctuation
+'$' Name.Variable
+'node' Name
+')' Punctuation
+'\n ' Text
+'case' Keyword
+' ' Text
+'text' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+' ' Text
+'return' Keyword
+' ' Text
+'$' Name.Variable
+'node' Name
+'\n ' Text
+'case' Keyword
+' ' Text
+'comment' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+' ' Text
+'return' Keyword
+' ' Text
+'$' Name.Variable
+'node' Name
+'\n ' Text
+'case' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+'bill' Name
+')' Punctuation
+' ' Text
+'return' Keyword
+' ' Text
+'local:bill' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'node' Name
+')' Punctuation
+'\n ' Text
+'case' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+'btitle' Name
+')' Punctuation
+' ' Text
+'return' Keyword
+' ' Text
+'local:btitle' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'node' Name
+')' Punctuation
+'\n ' Text
+'case' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+'section-id' Name
+')' Punctuation
+' ' Text
+'return' Keyword
+' ' Text
+'local:section-id' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'node' Name
+')' Punctuation
+'\n ' Text
+'case' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+'bill-text' Name
+')' Punctuation
+' ' Text
+'return' Keyword
+' ' Text
+'local:bill-text' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'node' Name
+')' Punctuation
+'\n ' Text
+'case' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+'strike' Name
+')' Punctuation
+' ' Text
+'return' Keyword
+' ' Text
+'local:strike' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'node' Name
+')' Punctuation
+'\n ' Text
+'default' Keyword
+' ' Text
+'return' Keyword
+' ' Text
+'local:passthru' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'node' Name
+')' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'(:' Comment
+' ' Comment
+'`' Comment
+'s' Comment
+'w' Comment
+'i' Comment
+'t' Comment
+'c' Comment
+'h' Comment
+'`' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'p' Comment
+'r' Comment
+'e' Comment
+'s' Comment
+'s' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'a' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+':)' Comment
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:noise' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'animal' Name
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'duck' Name
+' ' Text
+':=' Operator
+' ' Text
+'"Duck"' Literal.String.Double
+',' Punctuation
+'\n\t' Text
+'$' Name.Variable
+'quack' Name
+' ' Text
+':=' Operator
+' ' Text
+'"Quack"' Literal.String.Double
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'switch' Keyword
+' ' Text
+'(' Punctuation
+'$' Name.Variable
+'animal' Name
+')' Punctuation
+'\n\t\t\t' Text
+'case' Keyword
+' ' Text
+'"Cow"' Literal.String.Double
+' ' Text
+'return' Keyword
+' ' Text
+'"Moo"' Literal.String.Double
+'\n\t\t\t' Text
+'case' Keyword
+' ' Text
+"'Cat'" Literal.String.Single
+' ' Text
+'return' Keyword
+' ' Text
+"'Meow'" Literal.String.Single
+'\n\t\t\t' Text
+'case' Keyword
+' ' Text
+'$' Name.Variable
+'duck' Name
+' ' Text
+'return' Keyword
+' ' Text
+'$' Name.Variable
+'quack' Name
+'\n\t\t\t' Text
+'default' Keyword
+' ' Text
+'return' Keyword
+' ' Text
+'"What\'s that odd noise?"' Literal.String.Double
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'(:' Comment
+' ' Comment
+'`' Comment
+'g' Comment
+'r' Comment
+'o' Comment
+'u' Comment
+'p' Comment
+' ' Comment
+'b' Comment
+'y' Comment
+'`' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'p' Comment
+'r' Comment
+'e' Comment
+'s' Comment
+'s' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'w' Comment
+'i' Comment
+'t' Comment
+'h' Comment
+' ' Comment
+'b' Comment
+'i' Comment
+'n' Comment
+'d' Comment
+'i' Comment
+'n' Comment
+'g' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'a' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+':)' Comment
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:a-to-z' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'data' Name
+' ' Text
+'as' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+')' Punctuation
+'*' Punctuation
+' ' Text
+':=' Operator
+' ' Text
+'(' Punctuation
+'\n\t\t' Text
+'<' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+'A' Literal
+'p' Literal
+'p' Literal
+'l' Literal
+'e' Literal
+'s' Literal
+'</' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+',' Punctuation
+'\n\t\t' Text
+'<' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+'B' Literal
+'a' Literal
+'n' Literal
+'a' Literal
+'n' Literal
+'a' Literal
+'s' Literal
+'</' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+',' Punctuation
+'\n\t\t' Text
+'<' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+'A' Literal
+'p' Literal
+'r' Literal
+'i' Literal
+'c' Literal
+'o' Literal
+'t' Literal
+'s' Literal
+'</' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+',' Punctuation
+'\n\t\t' Text
+'<' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+'P' Literal
+'e' Literal
+'a' Literal
+'r' Literal
+'s' Literal
+'</' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+',' Punctuation
+'\n\t\t' Text
+'<' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+'B' Literal
+'r' Literal
+'a' Literal
+'m' Literal
+'b' Literal
+'l' Literal
+'e' Literal
+'s' Literal
+'</' Name.Tag
+'item' Name.Tag
+'>' Name.Tag
+'\n\t' Text
+')' Punctuation
+' ' Text
+'return' Keyword
+'\n\t\t' Text
+'<' Name.Tag
+'GroupedItems' Name.Tag
+'>' Name.Tag
+'{' Punctuation
+'\n\t\t\t' Text
+'for' Keyword
+' ' Text
+'$' Name.Variable
+'item' Name
+' ' Text
+'in' Operator.Word
+' ' Text
+'$' Name.Variable
+'data' Name
+'\n\t\t\t' Text
+'group by' Keyword
+' ' Text
+'$' Name.Variable
+'key' Name
+' ' Text
+':=' Operator
+' ' Text
+'upper-case' Name.Function
+'(' Punctuation
+'substring' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'item' Name
+',' Punctuation
+' ' Text
+'1' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'1' Literal.Number.Integer
+')' Punctuation
+')' Punctuation
+'\n\t\t\t' Text
+'order by' Keyword
+' ' Text
+'$' Name.Variable
+'key' Name
+'\n\t\t\t' Text
+'return' Keyword
+'\n\t\t\t\t' Text
+'<' Name.Tag
+'Group' Name.Tag
+' ' Text
+'key' Name.Tag
+'=' Operator
+'"' Punctuation
+'{' Punctuation
+'$' Name.Variable
+'key' Name
+'}' Punctuation
+'"' Punctuation
+'>' Name.Tag
+'{' Punctuation
+'$' Name.Variable
+'item' Name
+'}' Punctuation
+'</' Name.Tag
+'Group' Name.Tag
+'>' Name.Tag
+'\n\t\t' Text
+'}' Punctuation
+'</' Name.Tag
+'GroupedItems' Name.Tag
+'>' Name.Tag
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'(:' Comment
+' ' Comment
+'`' Comment
+'g' Comment
+'r' Comment
+'o' Comment
+'u' Comment
+'p' Comment
+' ' Comment
+'b' Comment
+'y' Comment
+'`' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'p' Comment
+'r' Comment
+'e' Comment
+'s' Comment
+'s' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'a' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+':)' Comment
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:plays-by-character' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'plays' Name
+' ' Text
+':=' Operator
+' ' Text
+'(' Punctuation
+'\n\t\t' Text
+'document' Keyword
+' ' Text
+'{' Punctuation
+'\n\t\t\t' Text
+'<' Name.Tag
+'play' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'title' Name.Tag
+'>' Name.Tag
+'H' Literal
+'a' Literal
+'m' Literal
+'l' Literal
+'e' Literal
+'t' Literal
+'</' Name.Tag
+'title' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'characters' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'H' Literal
+'a' Literal
+'m' Literal
+'l' Literal
+'e' Literal
+'t' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'C' Literal
+'l' Literal
+'a' Literal
+'u' Literal
+'d' Literal
+'i' Literal
+'u' Literal
+'s' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'P' Literal
+'o' Literal
+'l' Literal
+'o' Literal
+'n' Literal
+'i' Literal
+'u' Literal
+'s' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'R' Literal
+'o' Literal
+'s' Literal
+'e' Literal
+'n' Literal
+'c' Literal
+'r' Literal
+'a' Literal
+'n' Literal
+'t' Literal
+'z' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'G' Literal
+'u' Literal
+'i' Literal
+'l' Literal
+'d' Literal
+'e' Literal
+'n' Literal
+'s' Literal
+'t' Literal
+'e' Literal
+'r' Literal
+'n' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'F' Literal
+'r' Literal
+'a' Literal
+'n' Literal
+'c' Literal
+'i' Literal
+'s' Literal
+'c' Literal
+'o' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'R' Literal
+'e' Literal
+'y' Literal
+'n' Literal
+'a' Literal
+'l' Literal
+'d' Literal
+'o' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'</' Name.Tag
+'characters' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'</' Name.Tag
+'play' Name.Tag
+'>' Name.Tag
+'\n\t\t' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t' Text
+'document' Keyword
+' ' Text
+'{' Punctuation
+'\n\t\t\t' Text
+'<' Name.Tag
+'play' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'title' Name.Tag
+'>' Name.Tag
+'R' Literal
+'o' Literal
+'s' Literal
+'e' Literal
+'n' Literal
+'k' Literal
+'r' Literal
+'a' Literal
+'n' Literal
+'t' Literal
+'z' Literal
+' ' Literal
+'a' Literal
+'n' Literal
+'d' Literal
+' ' Literal
+'G' Literal
+'u' Literal
+'i' Literal
+'l' Literal
+'d' Literal
+'e' Literal
+'n' Literal
+'s' Literal
+'t' Literal
+'e' Literal
+'r' Literal
+'n' Literal
+' ' Literal
+'a' Literal
+'r' Literal
+'e' Literal
+' ' Literal
+'D' Literal
+'e' Literal
+'a' Literal
+'d' Literal
+'</' Name.Tag
+'title' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'characters' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'A' Literal
+'l' Literal
+'f' Literal
+'r' Literal
+'e' Literal
+'d' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'R' Literal
+'o' Literal
+'s' Literal
+'e' Literal
+'n' Literal
+'c' Literal
+'r' Literal
+'a' Literal
+'n' Literal
+'t' Literal
+'z' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'G' Literal
+'u' Literal
+'i' Literal
+'l' Literal
+'d' Literal
+'e' Literal
+'n' Literal
+'s' Literal
+'t' Literal
+'e' Literal
+'r' Literal
+'n' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'H' Literal
+'a' Literal
+'m' Literal
+'l' Literal
+'e' Literal
+'t' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'C' Literal
+'l' Literal
+'a' Literal
+'u' Literal
+'d' Literal
+'i' Literal
+'u' Literal
+'s' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'</' Name.Tag
+'characters' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'</' Name.Tag
+'play' Name.Tag
+'>' Name.Tag
+'\n\t\t' Text
+'}' Punctuation
+'\n\t' Text
+')' Punctuation
+' ' Text
+'return' Keyword
+'\n\n\t\t' Text
+'for' Keyword
+' ' Text
+'$' Name.Variable
+'play' Name
+' ' Text
+'in' Operator.Word
+' ' Text
+'$' Name.Variable
+'plays' Name
+'/' Punctuation
+'play' Name.Tag
+'\n\t\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'title' Name
+' ' Text
+':=' Operator
+' ' Text
+'$' Name.Variable
+'play' Name
+'/' Punctuation
+'title' Name.Tag
+'\n\t\t' Text
+'for' Keyword
+' ' Text
+'$' Name.Variable
+'character' Name
+' ' Text
+'in' Operator.Word
+' ' Text
+'$' Name.Variable
+'play' Name
+'/' Punctuation
+'characters' Name.Tag
+'/' Punctuation
+'character' Name.Tag
+'\n\t\t' Text
+'group by' Keyword
+' ' Text
+'$' Name.Variable
+'character' Name
+'\n\t\t' Text
+'return' Keyword
+'\n\t\t\t' Text
+'<' Name.Tag
+'character' Name.Tag
+' ' Text
+'name' Name.Tag
+'=' Operator
+'"' Punctuation
+'{' Punctuation
+'$' Name.Variable
+'character' Name
+'}' Punctuation
+'"' Punctuation
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'{' Punctuation
+'\n\t\t\t\t' Text
+'$' Name.Variable
+'title' Name
+' ' Text
+'!' Operator
+' ' Text
+'<' Name.Tag
+'play' Name.Tag
+'>' Name.Tag
+'{' Punctuation
+' ' Text
+'.' Punctuation
+' ' Text
+'}' Punctuation
+'</' Name.Tag
+'play' Name.Tag
+'>' Name.Tag
+'\n \t\t' Text
+'}' Punctuation
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'</' Name.Tag
+'character' Name.Tag
+'>' Name.Tag
+'\t\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+'\n\t' Text
+'%' Name.Decorator
+'other:a' Name.Decorator
+'\n\t' Text
+'%' Name.Decorator
+'private' Name.Decorator
+'\n\t' Text
+'%' Name.Decorator
+'other:b' Name.Decorator
+'(' Punctuation
+"'1'" Literal.String.Single
+')' Punctuation
+'\n\t' Text
+'%' Name.Decorator
+'other:c' Name.Decorator
+'(' Punctuation
+'"1"' Literal.String.Double
+',' Punctuation
+' ' Text
+'"2"' Literal.String.Double
+',' Punctuation
+' ' Text
+'"3"' Literal.String.Double
+',' Punctuation
+' ' Text
+'"4"' Literal.String.Double
+')' Punctuation
+'\n' Text
+
+'function' Keyword.Declaration
+' ' Text
+'local:very-annotated' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'thing' Name
+' ' Text
+':=' Operator
+' ' Text
+'"thing"' Literal.String.Double
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'$' Name.Variable
+'thing' Name
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'%' Name.Decorator
+'public' Name.Decorator
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:slightly-annotated' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'nothing' Name
+' ' Text
+':=' Operator
+' ' Text
+'(' Punctuation
+')' Punctuation
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'$' Name.Variable
+'nothing' Name
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:ordered' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'for' Keyword
+' ' Text
+'$' Name.Variable
+'hit' Name
+' ' Text
+'in' Operator.Word
+' ' Text
+'doc' Name.Function
+'(' Punctuation
+'"/db/doc-with-indexes.xml"' Literal.String.Double
+')' Punctuation
+'//' Punctuation
+'tei:p' Name.Tag
+'[' Punctuation
+'other:query' Name.Function
+'(' Punctuation
+'.' Punctuation
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'search-expression' Name
+')' Punctuation
+']' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'score' Name
+' ' Text
+'as' Keyword
+' ' Text
+'xs:float' Keyword.Type
+' ' Text
+':=' Operator
+' ' Text
+'other:score' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'hit' Name
+')' Punctuation
+'\n\t' Text
+'order by' Keyword
+' ' Text
+'$' Name.Variable
+'score' Name
+' ' Text
+'descending' Keyword
+'\n\t' Text
+'return' Keyword
+' ' Text
+'(' Punctuation
+'\n\t\t' Text
+'<' Name.Tag
+'p' Name.Tag
+'>' Name.Tag
+'S' Literal
+'c' Literal
+'o' Literal
+'r' Literal
+'e' Literal
+':' Literal
+' ' Literal
+'{' Punctuation
+'$' Name.Variable
+'score' Name
+'}' Punctuation
+':' Literal
+'</' Name.Tag
+'p' Name.Tag
+'>' Name.Tag
+',' Punctuation
+'\n\t\t' Text
+'other:summarize' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'hit' Name
+',' Punctuation
+' ' Text
+'<' Name.Tag
+'config' Name.Tag
+' ' Text
+'width' Name.Tag
+'=' Operator
+'"' Punctuation
+'4' Name.Attribute
+'0' Name.Attribute
+'"' Punctuation
+'/>' Name.Tag
+')' Punctuation
+'\n\t' Text
+')' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:concat-expr' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'postfix' Name
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'concatenated' Name
+' ' Text
+':=' Operator
+' ' Text
+'other:uri' Name.Function
+'(' Punctuation
+')' Punctuation
+' ' Text
+'||' Operator
+' ' Text
+'"/"' Literal.String.Double
+' ' Text
+'||' Operator
+' ' Text
+'$' Name.Variable
+'postfix' Name
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'$' Name.Variable
+'concatenated' Name
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:human-units' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'bytes' Name
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'unit' Name
+' ' Text
+':=' Operator
+' ' Text
+'if' Keyword
+'(' Punctuation
+'$' Name.Variable
+'bytes' Name
+' ' Text
+'>' Operator
+' ' Text
+'math:pow' Name.Function
+'(' Punctuation
+'1024' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'3' Literal.Number.Integer
+')' Punctuation
+')' Punctuation
+' ' Text
+'then' Keyword
+'\n\t\t' Text
+'(' Punctuation
+'math:pow' Name.Function
+'(' Punctuation
+'1024' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'3' Literal.Number.Integer
+')' Punctuation
+',' Punctuation
+' ' Text
+'"GB"' Literal.String.Double
+')' Punctuation
+'\n\t' Text
+'else' Keyword
+' ' Text
+'if' Keyword
+'(' Punctuation
+'$' Name.Variable
+'bytes' Name
+' ' Text
+'>' Operator
+' ' Text
+'math:pow' Name.Function
+'(' Punctuation
+'1024' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'2' Literal.Number.Integer
+')' Punctuation
+')' Punctuation
+' ' Text
+'then' Keyword
+'\n\t\t' Text
+'(' Punctuation
+'math:pow' Name.Function
+'(' Punctuation
+'1024' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'2' Literal.Number.Integer
+')' Punctuation
+',' Punctuation
+' ' Text
+'"MB"' Literal.String.Double
+')' Punctuation
+'\n\t' Text
+'else' Keyword
+'\n\t\t' Text
+'(' Punctuation
+'1024' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'"KB"' Literal.String.Double
+')' Punctuation
+'\n\t' Text
+'return' Keyword
+'\n\t\t' Text
+'format-number' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'bytes' Name
+' ' Text
+'div' Keyword
+' ' Text
+'$' Name.Variable
+'unit' Name
+'[' Punctuation
+'1' Literal.Number.Integer
+']' Punctuation
+',' Punctuation
+' ' Text
+'".00"' Literal.String.Double
+')' Punctuation
+' ' Text
+'||' Operator
+' ' Text
+'" "' Literal.String.Double
+' ' Text
+'||' Operator
+' ' Text
+'$' Name.Variable
+'unit' Name
+'[' Punctuation
+'2' Literal.Number.Integer
+']' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:merge-simple' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'a' Name
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+'+' Operator
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'b' Name
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+'+' Operator
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+'+' Operator
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'(' Punctuation
+'$' Name.Variable
+'a' Name
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'b' Name
+')' Punctuation
+'\t\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'(:' Comment
+' ' Comment
+'h' Comment
+'i' Comment
+'g' Comment
+'h' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'o' Comment
+'r' Comment
+'d' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'f' Comment
+'u' Comment
+'n' Comment
+'c' Comment
+'t' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'a' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+'1' Comment
+' ' Comment
+':)' Comment
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:apply' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'func' Name
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'value' Name
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'$' Name.Variable
+'func' Name
+'(' Punctuation
+'$' Name.Variable
+'value' Name
+')' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'(:' Comment
+' ' Comment
+'h' Comment
+'i' Comment
+'g' Comment
+'h' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'o' Comment
+'r' Comment
+'d' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'f' Comment
+'u' Comment
+'n' Comment
+'c' Comment
+'t' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'a' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+'2' Comment
+' ' Comment
+':)' Comment
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:apply-all' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'func' Name
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'list' Name
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'$' Name.Variable
+'list' Name
+' ' Text
+'!' Operator
+' ' Text
+'$' Name.Variable
+'func' Name
+'(' Punctuation
+'.' Operator
+')' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'(:' Comment
+' ' Comment
+'h' Comment
+'i' Comment
+'g' Comment
+'h' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'o' Comment
+'r' Comment
+'d' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'f' Comment
+'u' Comment
+'n' Comment
+'c' Comment
+'t' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'a' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+'3' Comment
+' ' Comment
+':)' Comment
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:apply-all-long' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'func' Name
+' ' Text
+'as' Keyword
+' ' Text
+'function' Keyword.Type
+'(' Punctuation
+'xs:string' Keyword.Type
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'list' Name
+')' Punctuation
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'$' Name.Variable
+'list' Name
+' ' Text
+'!' Operator
+' ' Text
+'$' Name.Variable
+'func' Name
+'(' Punctuation
+'.' Operator
+')' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'(:' Comment
+' ' Comment
+'h' Comment
+'i' Comment
+'g' Comment
+'h' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'o' Comment
+'r' Comment
+'d' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'f' Comment
+'u' Comment
+'n' Comment
+'c' Comment
+'t' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'a' Comment
+'m' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+'4' Comment
+' ' Comment
+':)' Comment
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'local:merge' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'func' Name
+' ' Text
+'as' Keyword
+' ' Text
+'function' Keyword.Type
+'(' Punctuation
+'xs:string' Keyword.Type
+'+' Operator
+',' Punctuation
+' ' Text
+'xs:string' Name.Tag
+'+' Operator
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+'+' Operator
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'a' Name
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+'+' Operator
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'b' Name
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+'+' Operator
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+'+' Operator
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'$' Name.Variable
+'func' Name
+'(' Punctuation
+'$' Name.Variable
+'a' Name
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'b' Name
+')' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'to-upper' Name
+' ' Text
+':=' Operator
+' ' Text
+'upper-case' Name.Function
+'#' Keyword.Type
+'1' Literal.Number.Integer
+'\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'to-upper-long' Name
+' ' Text
+'as' Keyword
+' ' Text
+'function' Keyword.Type
+'(' Punctuation
+'xs:string' Keyword.Type
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+' ' Text
+':=' Operator
+' ' Text
+'upper-case' Name.Function
+'#' Keyword.Type
+'1' Literal.Number.Integer
+'\n' Text
+
+'return' Keyword
+'\n ' Text
+'<' Name.Tag
+'case' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+'{' Punctuation
+'\n ' Text
+'local:apply-all' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'to-upper' Name
+',' Punctuation
+' ' Text
+'(' Punctuation
+'"Hello"' Literal.String.Double
+',' Punctuation
+' ' Text
+'"world!"' Literal.String.Double
+')' Punctuation
+')' Punctuation
+' ' Text
+'!' Operator
+' ' Text
+'<' Name.Tag
+'upper' Name.Tag
+'>' Name.Tag
+'{' Punctuation
+'.' Punctuation
+'}' Punctuation
+'</' Name.Tag
+'upper' Name.Tag
+'>' Name.Tag
+',' Punctuation
+'\n ' Text
+'local:apply-all-long' Name.Function
+'(' Punctuation
+'lower-case' Name.Function
+'#' Keyword.Type
+'1' Literal.Number.Integer
+',' Punctuation
+' ' Text
+'(' Punctuation
+'"Hello"' Literal.String.Double
+',' Punctuation
+' ' Text
+'"world!"' Literal.String.Double
+')' Punctuation
+')' Punctuation
+' ' Text
+'!' Operator
+' ' Text
+'<' Name.Tag
+'lower' Name.Tag
+'>' Name.Tag
+'{' Punctuation
+'.' Punctuation
+'}' Punctuation
+'</' Name.Tag
+'lower' Name.Tag
+'>' Name.Tag
+'\n ' Text
+'}' Punctuation
+'\n' Literal
+
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+'</' Name.Tag
+'case' Name.Tag
+'>' Name.Tag
+'\n' Text
diff --git a/tests/lexers/xquery/example3.txt b/tests/lexers/xquery/example3.txt
new file mode 100644
index 00000000..c32b0282
--- /dev/null
+++ b/tests/lexers/xquery/example3.txt
@@ -0,0 +1,1902 @@
+---input---
+(: made up functions, etc just to test xquery parsing (: even embedded comments
+on multiple :)
+lines
+:)
+xquery version "1.0";
+
+module namespace xqueryexample "http://example.com/namespace";
+import module namespace importedns = "http://example.com/ns/imported" at "no/such/file.xqy";
+
+declare namespace sess = "com.example.session";
+
+declare variable $amazing := "awesome";
+declare variable $SESSIONS as element(sess:session)* := c:sessions();
+
+declare option sess:clear "false";
+
+define function whatsit($param as xs:string) as xs:string {
+ let $var1 := 1
+ let $var2 := 2
+ return (1 + 2 div ($var1 + $var2))
+
+ let $let := <x>"test"</x>
+ return (: some whitespace :) element element {
+ attribute attribute { 1 },
+ element test { 'a' },
+ attribute foo { "bar" },
+ fn:doc()[ foo/@bar eq $let ],
+ //x/with/another/*/*:version/xpath/@attr }
+};
+
+let $bride := "Bride"
+let $test := validate lax { <some>html</some> }
+let $test := validate strict { <some>html</some> }
+let $test := validate { <some>html</some> }
+let $test := $var1/*:Article (: comment here :) [fn:not()]
+let $test := $var1/@*:name/fn:string()
+
+let $noop := ordered { $test }
+let $noop := unordered { $test }
+
+let $noop :=
+ for $version at $i in $versions/version
+ let $row := if($i mod 2 eq 0) then "even" else "odd"
+ order by $version descending
+ return
+
+return
+<html xmlns="http://www.w3.org/1999/xhtml">
+{
+ <outer>
+ <movie>
+ <title>The Princess { fn:capitalize($bride) }</title>
+ </movie>
+ <form action="" method="post" id="session-form" call="callsomething()">
+ <input type="hidden" name="{$d:DEBUG-FIELD}" value="{$d:DEBUG}"/>
+ {
+ (: placeholder for local sessions :)
+ element div {
+ attribute id { "sessions-local" },
+ attribute class { "hidden" },
+ element h1 { "Local Sessions" },
+ element p {
+ 'These sessions use storage provided by your browser.',
+ 'You can also ',
+ element a {
+ attribute href { 'session-import-local.xqy' },
+ 'import' },
+ ' sessions from local XML files.'
+ }
+ }
+ }
+ {
+ for $i in $sessions
+ let $id := c:session-id($i)
+ let $uri := c:session-uri($i)
+ (: we only care about the lock that expires last :)
+ let $conflicting := c:conflicting-locks($uri, 1)
+ let $name as xs:string := ($i/sess:name, "(unnamed)")[1]
+ return element tr {
+ element td { $name },
+ element td { string($i/sec:user) },
+ element td { data($i/sess:created) },
+ element td { data($i/sess:last-modified) },
+ element td {
+ if (empty($conflicting)) then () else
+ text {
+ "by", $conflicting/lock:owner,
+ "until", adjust-dateTime-to-timezone(
+ x:epoch-seconds-to-dateTime(
+ $conflicting/lock:timestamp + $conflicting/lock:timeout
+ )
+ )
+ },
+ (: only show resume button if there are no conflicting locks :)
+ element input {
+ attribute type { "button" },
+ attribute title {
+ data($i/sess:query-buffers/sess:query[1]) },
+ attribute onclick {
+ concat("list.resumeSession('", $id, "')") },
+ attribute value {
+ "Resume", (' ', $id)[ $d:DEBUG ] }
+ }[ not($conflicting) ],
+ $x:NBSP,
+ (: clone button :)
+ element input {
+ attribute type { "button" },
+ attribute title { "clone this session" },
+ attribute onclick {
+ concat("list.cloneSession('", $id, "', this)") },
+ attribute value { "Clone", (' ', $id)[ $d:DEBUG ] }
+ },
+ $x:NBSP,
+ (: export button :)
+ element input {
+ attribute type { "button" },
+ attribute title { "export this session" },
+ attribute onclick {
+ concat("list.exportServerSession('", $id, "', this)") },
+ attribute value { "Export", (' ', $id)[ $d:DEBUG ] }
+ },
+ $x:NBSP,
+ (: only show delete button if there are no conflicting locks :)
+ element input {
+ attribute type { "button" },
+ attribute title { "permanently delete this session" },
+ attribute onclick {
+ concat("list.deleteSession('", $id, "', this)") },
+ attribute value { "Delete", (' ', $id)[ $d:DEBUG ] }
+ }[ not($conflicting) ]
+ }
+ }
+ }
+ </form>
+ </outer>
+}
+ <tr><td><!-- some commented things-->&nbsp;</td></tr>
+</html>
+
+---tokens---
+'(:' Comment
+' ' Comment
+'m' Comment
+'a' Comment
+'d' Comment
+'e' Comment
+' ' Comment
+'u' Comment
+'p' Comment
+' ' Comment
+'f' Comment
+'u' Comment
+'n' Comment
+'c' Comment
+'t' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+'s' Comment
+',' Comment
+' ' Comment
+'e' Comment
+'t' Comment
+'c' Comment
+' ' Comment
+'j' Comment
+'u' Comment
+'s' Comment
+'t' Comment
+' ' Comment
+'t' Comment
+'o' Comment
+' ' Comment
+'t' Comment
+'e' Comment
+'s' Comment
+'t' Comment
+' ' Comment
+'x' Comment
+'q' Comment
+'u' Comment
+'e' Comment
+'r' Comment
+'y' Comment
+' ' Comment
+'p' Comment
+'a' Comment
+'r' Comment
+'s' Comment
+'i' Comment
+'n' Comment
+'g' Comment
+' ' Comment
+'(:' Comment
+' ' Comment
+'e' Comment
+'v' Comment
+'e' Comment
+'n' Comment
+' ' Comment
+'e' Comment
+'m' Comment
+'b' Comment
+'e' Comment
+'d' Comment
+'d' Comment
+'e' Comment
+'d' Comment
+' ' Comment
+'c' Comment
+'o' Comment
+'m' Comment
+'m' Comment
+'e' Comment
+'n' Comment
+'t' Comment
+'s' Comment
+'\n' Comment
+
+'o' Comment
+'n' Comment
+' ' Comment
+'m' Comment
+'u' Comment
+'l' Comment
+'t' Comment
+'i' Comment
+'p' Comment
+'l' Comment
+'e' Comment
+' ' Comment
+':)' Comment
+'\n' Comment
+
+'l' Comment
+'i' Comment
+'n' Comment
+'e' Comment
+'s' Comment
+'\n' Comment
+
+':)' Comment
+'\n' Text
+
+'xquery' Keyword.Pseudo
+' ' Text
+'version' Keyword.Pseudo
+' ' Text
+'"1.0"' Literal.String.Double
+';' Punctuation
+'\n\n' Text
+
+'module' Keyword.Declaration
+' ' Text
+'namespace' Keyword.Declaration
+' ' Text
+'xqueryexample' Name.Namespace
+' ' Text
+'"http://example.com/namespace"' Literal.String.Double
+';' Punctuation
+'\n' Text
+
+'import' Keyword.Pseudo
+' ' Text
+'module' Keyword.Pseudo
+' ' Text
+'namespace' Keyword
+' ' Text
+'importedns' Name.Namespace
+' ' Text
+'=' Operator
+' ' Text
+'"http://example.com/ns/imported"' Literal.String.Double
+' ' Text
+'at' Keyword
+' ' Text
+'"no/such/file.xqy"' Literal.String.Double
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'namespace' Keyword.Declaration
+' ' Text
+'sess' Name.Namespace
+' ' Text
+'=' Operator
+' ' Text
+'"com.example.session"' Literal.String.Double
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'variable' Keyword.Declaration
+' ' Text
+'$' Name.Variable
+'amazing' Name
+' ' Text
+':=' Operator
+' ' Text
+'"awesome"' Literal.String.Double
+';' Punctuation
+'\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'variable' Keyword.Declaration
+' ' Text
+'$' Name.Variable
+'SESSIONS' Name
+' ' Text
+'as' Keyword
+' ' Text
+'element' Name.Tag
+'' Text
+'(' Punctuation
+'sess:session' Name
+')' Punctuation
+'*' Operator
+' ' Text
+':=' Operator
+' ' Text
+'c:sessions' Name.Function
+'(' Punctuation
+')' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'declare' Keyword.Declaration
+' ' Text
+'option' Keyword.Declaration
+' ' Text
+'sess:clear' Name.Variable
+' ' Text
+'"false"' Literal.String.Double
+';' Punctuation
+'\n\n' Text
+
+'define' Keyword.Declaration
+' ' Text
+'function' Keyword.Declaration
+' ' Text
+'whatsit' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'param' Name
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+')' Punctuation
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+' ' Text
+'{' Punctuation
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'var1' Name
+' ' Text
+':=' Operator
+' ' Text
+'1' Literal.Number.Integer
+'\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'var2' Name
+' ' Text
+':=' Operator
+' ' Text
+'2' Literal.Number.Integer
+'\n\t' Text
+'return' Keyword
+' ' Text
+'(' Punctuation
+'1' Literal.Number.Integer
+' ' Text
+'+' Operator
+' ' Text
+'2' Literal.Number.Integer
+' ' Text
+'div' Keyword
+' ' Text
+'(' Punctuation
+'$' Name.Variable
+'var1' Name
+' ' Text
+'+' Operator
+' ' Text
+'$' Name.Variable
+'var2' Name
+')' Punctuation
+')' Punctuation
+'\n\n\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'let' Name
+' ' Text
+':=' Operator
+' ' Text
+'<' Name.Tag
+'x' Name.Tag
+'>' Name.Tag
+'"' Literal
+'t' Literal
+'e' Literal
+'s' Literal
+'t' Literal
+'"' Literal
+'</' Name.Tag
+'x' Name.Tag
+'>' Name.Tag
+'\n\t' Text
+'return' Keyword
+' ' Text
+'(:' Comment
+' ' Comment
+'s' Comment
+'o' Comment
+'m' Comment
+'e' Comment
+' ' Comment
+'w' Comment
+'h' Comment
+'i' Comment
+'t' Comment
+'e' Comment
+'s' Comment
+'p' Comment
+'a' Comment
+'c' Comment
+'e' Comment
+' ' Comment
+':)' Comment
+' ' Text
+'element' Keyword
+' ' Text
+'element' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'attribute' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'1' Literal.Number.Integer
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'test' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+"'a'" Literal.String.Single
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'foo' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"bar"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'fn:doc' Name.Function
+'(' Punctuation
+')' Punctuation
+'[' Punctuation
+' ' Text
+'foo' Name.Tag
+'/' Punctuation
+'@bar' Name.Attribute
+' ' Text
+'eq' Operator.Word
+' ' Text
+'$' Name.Variable
+'let' Name
+' ' Text
+']' Punctuation
+',' Punctuation
+'\n ' Text
+'//' Punctuation
+'x' Name.Tag
+'/' Punctuation
+'with' Keyword
+'/' Punctuation
+'another' Name.Tag
+'/' Punctuation
+'*' Name.Tag
+'/' Punctuation
+'*:version' Name.Tag
+'/' Punctuation
+'xpath' Name.Tag
+'/' Punctuation
+'@attr' Name.Attribute
+' ' Text
+'}' Punctuation
+'\n' Text
+
+'}' Punctuation
+';' Punctuation
+'\n\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'bride' Name
+' ' Text
+':=' Operator
+' ' Text
+'"Bride"' Literal.String.Double
+'\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'test' Name
+' ' Text
+':=' Operator
+' ' Text
+'validate' Keyword
+' ' Text
+'lax' Keyword
+' ' Text
+'{' Punctuation
+' ' Text
+'<' Name.Tag
+'some' Name.Tag
+'>' Name.Tag
+'h' Literal
+'t' Literal
+'m' Literal
+'l' Literal
+'</' Name.Tag
+'some' Name.Tag
+'>' Name.Tag
+' ' Text
+'}' Punctuation
+'\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'test' Name
+' ' Text
+':=' Operator
+' ' Text
+'validate' Keyword
+' ' Text
+'strict' Keyword
+' ' Text
+'{' Punctuation
+' ' Text
+'<' Name.Tag
+'some' Name.Tag
+'>' Name.Tag
+'h' Literal
+'t' Literal
+'m' Literal
+'l' Literal
+'</' Name.Tag
+'some' Name.Tag
+'>' Name.Tag
+' ' Text
+'}' Punctuation
+'\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'test' Name
+' ' Text
+':=' Operator
+' ' Text
+'validate' Keyword
+' ' Text
+'{' Punctuation
+' ' Text
+'<' Name.Tag
+'some' Name.Tag
+'>' Name.Tag
+'h' Literal
+'t' Literal
+'m' Literal
+'l' Literal
+'</' Name.Tag
+'some' Name.Tag
+'>' Name.Tag
+' ' Text
+'}' Punctuation
+'\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'test' Name
+' ' Text
+':=' Operator
+' ' Text
+'$' Name.Variable
+'var1' Name
+'/' Punctuation
+'*:Article' Name.Tag
+' ' Text
+'(:' Comment
+' ' Comment
+'c' Comment
+'o' Comment
+'m' Comment
+'m' Comment
+'e' Comment
+'n' Comment
+'t' Comment
+' ' Comment
+'h' Comment
+'e' Comment
+'r' Comment
+'e' Comment
+' ' Comment
+':)' Comment
+' ' Text
+'[' Punctuation
+'fn:not' Name.Function
+'(' Punctuation
+')' Punctuation
+']' Punctuation
+'\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'test' Name
+' ' Text
+':=' Operator
+' ' Text
+'$' Name.Variable
+'var1' Name
+'/' Punctuation
+'@*:name' Name.Attribute
+'/' Punctuation
+'fn:string' Name.Function
+'(' Punctuation
+')' Punctuation
+'\n\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'noop' Name
+' ' Text
+':=' Operator
+' ' Text
+'ordered' Keyword
+' ' Text
+'{' Punctuation
+' ' Text
+'$' Name.Variable
+'test' Name
+' ' Text
+'}' Punctuation
+'\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'noop' Name
+' ' Text
+':=' Operator
+' ' Text
+'unordered' Keyword
+' ' Text
+'{' Punctuation
+' ' Text
+'$' Name.Variable
+'test' Name
+' ' Text
+'}' Punctuation
+'\n\n' Text
+
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'noop' Name
+' ' Text
+':=' Operator
+'\n\t' Text
+'for' Keyword
+' ' Text
+'$' Name.Variable
+'version' Name
+' ' Text
+'at' Keyword
+' ' Text
+'$' Name.Variable
+'i' Name
+' ' Text
+'in' Operator.Word
+' ' Text
+'$' Name.Variable
+'versions' Name
+'/' Punctuation
+'version' Name.Tag
+'\n\t\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'row' Name
+' ' Text
+':=' Operator
+' ' Text
+'if' Keyword
+'(' Punctuation
+'$' Name.Variable
+'i' Name
+' ' Text
+'mod' Keyword
+' ' Text
+'2' Literal.Number.Integer
+' ' Text
+'eq' Operator.Word
+' ' Text
+'0' Literal.Number.Integer
+')' Punctuation
+' ' Text
+'then' Keyword
+' ' Text
+'"even"' Literal.String.Double
+' ' Text
+'else' Keyword
+' ' Text
+'"odd"' Literal.String.Double
+'\n\t\t' Text
+'order by' Keyword
+' ' Text
+'$' Name.Variable
+'version' Name
+' ' Text
+'descending' Keyword
+'\n\t\t' Text
+'return' Keyword
+'\n\n' Text
+
+'return' Keyword
+'\n' Text
+
+'<' Name.Tag
+'html' Name.Tag
+' ' Text
+'xmlns' Name.Tag
+'=' Operator
+'"' Punctuation
+'h' Name.Attribute
+'t' Name.Attribute
+'t' Name.Attribute
+'p' Name.Attribute
+':' Name.Attribute
+'/' Name.Attribute
+'/' Name.Attribute
+'w' Name.Attribute
+'w' Name.Attribute
+'w' Name.Attribute
+'.' Name.Attribute
+'w' Name.Attribute
+'3' Name.Attribute
+'.' Name.Attribute
+'o' Name.Attribute
+'r' Name.Attribute
+'g' Name.Attribute
+'/' Name.Attribute
+'1' Name.Attribute
+'9' Name.Attribute
+'9' Name.Attribute
+'9' Name.Attribute
+'/' Name.Attribute
+'x' Name.Attribute
+'h' Name.Attribute
+'t' Name.Attribute
+'m' Name.Attribute
+'l' Name.Attribute
+'"' Punctuation
+'>' Name.Tag
+'\n' Literal
+
+'{' Punctuation
+'\n\t' Text
+'<' Name.Tag
+'outer' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'<' Name.Tag
+'movie' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'<' Name.Tag
+'title' Name.Tag
+'>' Name.Tag
+'T' Literal
+'h' Literal
+'e' Literal
+' ' Literal
+'P' Literal
+'r' Literal
+'i' Literal
+'n' Literal
+'c' Literal
+'e' Literal
+'s' Literal
+'s' Literal
+' ' Literal
+'{' Punctuation
+' ' Text
+'fn:capitalize' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'bride' Name
+')' Punctuation
+' ' Text
+'}' Punctuation
+'</' Name.Tag
+'title' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'</' Name.Tag
+'movie' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'<' Name.Tag
+'form' Name.Tag
+' ' Text
+'action' Name.Tag
+'=' Operator
+'"' Punctuation
+'"' Punctuation
+' ' Text
+'method' Name.Tag
+'=' Operator
+'"' Punctuation
+'p' Name.Attribute
+'o' Name.Attribute
+'s' Name.Attribute
+'t' Name.Attribute
+'"' Punctuation
+' ' Text
+'id' Name.Tag
+'=' Operator
+'"' Punctuation
+'s' Name.Attribute
+'e' Name.Attribute
+'s' Name.Attribute
+'s' Name.Attribute
+'i' Name.Attribute
+'o' Name.Attribute
+'n' Name.Attribute
+'-' Name.Attribute
+'f' Name.Attribute
+'o' Name.Attribute
+'r' Name.Attribute
+'m' Name.Attribute
+'"' Punctuation
+' ' Text
+'call' Name.Tag
+'=' Operator
+'"' Punctuation
+'c' Name.Attribute
+'a' Name.Attribute
+'l' Name.Attribute
+'l' Name.Attribute
+'s' Name.Attribute
+'o' Name.Attribute
+'m' Name.Attribute
+'e' Name.Attribute
+'t' Name.Attribute
+'h' Name.Attribute
+'i' Name.Attribute
+'n' Name.Attribute
+'g' Name.Attribute
+'(' Name.Attribute
+')' Name.Attribute
+'"' Punctuation
+'>' Name.Tag
+'\n' Literal
+
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+'<' Name.Tag
+'input' Name.Tag
+' ' Text
+'type' Name.Tag
+'=' Operator
+'"' Punctuation
+'h' Name.Attribute
+'i' Name.Attribute
+'d' Name.Attribute
+'d' Name.Attribute
+'e' Name.Attribute
+'n' Name.Attribute
+'"' Punctuation
+' ' Text
+'name' Name.Tag
+'=' Operator
+'"' Punctuation
+'{' Punctuation
+'$' Name.Variable
+'d:DEBUG-FIELD' Name
+'}' Punctuation
+'"' Punctuation
+' ' Text
+'value' Name.Tag
+'=' Operator
+'"' Punctuation
+'{' Punctuation
+'$' Name.Variable
+'d:DEBUG' Name
+'}' Punctuation
+'"' Punctuation
+'/>' Name.Tag
+'\n' Literal
+
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+' ' Literal
+'{' Punctuation
+'\n\t\t\t\t' Text
+'(:' Comment
+' ' Comment
+'p' Comment
+'l' Comment
+'a' Comment
+'c' Comment
+'e' Comment
+'h' Comment
+'o' Comment
+'l' Comment
+'d' Comment
+'e' Comment
+'r' Comment
+' ' Comment
+'f' Comment
+'o' Comment
+'r' Comment
+' ' Comment
+'l' Comment
+'o' Comment
+'c' Comment
+'a' Comment
+'l' Comment
+' ' Comment
+'s' Comment
+'e' Comment
+'s' Comment
+'s' Comment
+'i' Comment
+'o' Comment
+'n' Comment
+'s' Comment
+' ' Comment
+':)' Comment
+'\n\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'div' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'id' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"sessions-local"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'class' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"hidden"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'h1' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"Local Sessions"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'p' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t' Text
+"'These sessions use storage provided by your browser.'" Literal.String.Single
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+"'You can also '" Literal.String.Single
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'a' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'href' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+"'session-import-local.xqy'" Literal.String.Single
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+"'import'" Literal.String.Single
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+"' sessions from local XML files.'" Literal.String.Single
+'\n\t\t\t\t\t' Text
+'}' Punctuation
+'\n\t\t\t\t' Text
+'}' Punctuation
+'\n\t\t\t' Text
+'}' Punctuation
+'\n' Literal
+
+'\t' Literal
+'\t' Literal
+'\t' Literal
+'{' Punctuation
+'\n\t\t\t\t' Text
+'for' Keyword
+' ' Text
+'$' Name.Variable
+'i' Name
+' ' Text
+'in' Operator.Word
+' ' Text
+'$' Name.Variable
+'sessions' Name
+'\n\t\t\t\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'id' Name
+' ' Text
+':=' Operator
+' ' Text
+'c:session-id' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'i' Name
+')' Punctuation
+'\n\t\t\t\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'uri' Name
+' ' Text
+':=' Operator
+' ' Text
+'c:session-uri' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'i' Name
+')' Punctuation
+'\n\t\t\t\t' Text
+'(:' Comment
+' ' Comment
+'w' Comment
+'e' Comment
+' ' Comment
+'o' Comment
+'n' Comment
+'l' Comment
+'y' Comment
+' ' Comment
+'c' Comment
+'a' Comment
+'r' Comment
+'e' Comment
+' ' Comment
+'a' Comment
+'b' Comment
+'o' Comment
+'u' Comment
+'t' Comment
+' ' Comment
+'t' Comment
+'h' Comment
+'e' Comment
+' ' Comment
+'l' Comment
+'o' Comment
+'c' Comment
+'k' Comment
+' ' Comment
+'t' Comment
+'h' Comment
+'a' Comment
+'t' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'p' Comment
+'i' Comment
+'r' Comment
+'e' Comment
+'s' Comment
+' ' Comment
+'l' Comment
+'a' Comment
+'s' Comment
+'t' Comment
+' ' Comment
+':)' Comment
+'\n\t\t\t\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'conflicting' Name
+' ' Text
+':=' Operator
+' ' Text
+'c:conflicting-locks' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'uri' Name
+',' Punctuation
+' ' Text
+'1' Literal.Number.Integer
+')' Punctuation
+'\n\t\t\t\t' Text
+'let' Keyword
+' ' Text
+'$' Name.Variable
+'name' Name
+' ' Text
+'as' Keyword
+' ' Text
+'xs:string' Keyword.Type
+' ' Text
+':=' Operator
+' ' Text
+'(' Punctuation
+'$' Name.Variable
+'i' Name
+'/' Punctuation
+'sess:name' Name.Tag
+',' Punctuation
+' ' Text
+'"(unnamed)"' Literal.String.Double
+')' Punctuation
+'[' Punctuation
+'1' Literal.Number.Integer
+']' Punctuation
+'\n\t\t\t\t' Text
+'return' Keyword
+' ' Text
+'element' Keyword
+' ' Text
+'tr' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'td' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'$' Name.Variable
+'name' Name
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'td' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'string' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'i' Name
+'/' Punctuation
+'sec:user' Name.Tag
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'td' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'data' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'i' Name
+'/' Punctuation
+'sess:created' Name.Tag
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'td' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'data' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'i' Name
+'/' Punctuation
+'sess:last-modified' Name.Tag
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'td' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t' Text
+'if' Keyword
+' ' Text
+'(' Punctuation
+'empty' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'conflicting' Name
+')' Punctuation
+')' Punctuation
+' ' Text
+'then' Keyword
+' ' Text
+'(' Punctuation
+')' Punctuation
+' ' Text
+'else' Keyword
+'\n\t\t\t\t\t\t' Text
+'text' Keyword
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'"by"' Literal.String.Double
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'conflicting' Name
+'/' Punctuation
+'lock:owner' Name.Tag
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'"until"' Literal.String.Double
+',' Punctuation
+' ' Text
+'adjust-dateTime-to-timezone' Name.Function
+'(' Punctuation
+'\n\t\t\t\t\t\t\t\t' Text
+'x:epoch-seconds-to-dateTime' Name.Function
+'(' Punctuation
+'\n\t\t\t\t\t\t\t\t\t' Text
+'$' Name.Variable
+'conflicting' Name
+'/' Punctuation
+'lock:timestamp' Name.Tag
+' ' Text
+'+' Operator
+' ' Text
+'$' Name.Variable
+'conflicting' Name
+'/' Punctuation
+'lock:timeout' Name.Tag
+'\n\t\t\t\t\t\t\t\t' Text
+')' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+')' Punctuation
+'\n\t\t\t\t\t\t' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'(:' Comment
+' ' Comment
+'o' Comment
+'n' Comment
+'l' Comment
+'y' Comment
+' ' Comment
+'s' Comment
+'h' Comment
+'o' Comment
+'w' Comment
+' ' Comment
+'r' Comment
+'e' Comment
+'s' Comment
+'u' Comment
+'m' Comment
+'e' Comment
+' ' Comment
+'b' Comment
+'u' Comment
+'t' Comment
+'t' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'i' Comment
+'f' Comment
+' ' Comment
+'t' Comment
+'h' Comment
+'e' Comment
+'r' Comment
+'e' Comment
+' ' Comment
+'a' Comment
+'r' Comment
+'e' Comment
+' ' Comment
+'n' Comment
+'o' Comment
+' ' Comment
+'c' Comment
+'o' Comment
+'n' Comment
+'f' Comment
+'l' Comment
+'i' Comment
+'c' Comment
+'t' Comment
+'i' Comment
+'n' Comment
+'g' Comment
+' ' Comment
+'l' Comment
+'o' Comment
+'c' Comment
+'k' Comment
+'s' Comment
+' ' Comment
+':)' Comment
+'\n\t\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'input' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'type' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"button"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'title' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t\t' Text
+'data' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'i' Name
+'/' Punctuation
+'sess:query-buffers' Name.Tag
+'/' Punctuation
+'sess:query' Name.Tag
+'[' Punctuation
+'1' Literal.Number.Integer
+']' Punctuation
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'onclick' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t\t' Text
+'concat' Name.Function
+'(' Punctuation
+'"list.resumeSession(\'"' Literal.String.Double
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'id' Name
+',' Punctuation
+' ' Text
+'"\')"' Literal.String.Double
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'value' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t\t' Text
+'"Resume"' Literal.String.Double
+',' Punctuation
+' ' Text
+'(' Punctuation
+"' '" Literal.String.Single
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'id' Name
+')' Punctuation
+'[' Punctuation
+' ' Text
+'$' Name.Variable
+'d:DEBUG' Name
+' ' Text
+']' Punctuation
+' ' Text
+'}' Punctuation
+'\n\t\t\t\t\t\t' Text
+'}' Punctuation
+'[' Punctuation
+' ' Text
+'not' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'conflicting' Name
+')' Punctuation
+' ' Text
+']' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'$' Name.Variable
+'x:NBSP' Name
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'(:' Comment
+' ' Comment
+'c' Comment
+'l' Comment
+'o' Comment
+'n' Comment
+'e' Comment
+' ' Comment
+'b' Comment
+'u' Comment
+'t' Comment
+'t' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+':)' Comment
+'\n\t\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'input' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'type' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"button"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'title' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"clone this session"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'onclick' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t\t' Text
+'concat' Name.Function
+'(' Punctuation
+'"list.cloneSession(\'"' Literal.String.Double
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'id' Name
+',' Punctuation
+' ' Text
+'"\', this)"' Literal.String.Double
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'value' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"Clone"' Literal.String.Double
+',' Punctuation
+' ' Text
+'(' Punctuation
+"' '" Literal.String.Single
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'id' Name
+')' Punctuation
+'[' Punctuation
+' ' Text
+'$' Name.Variable
+'d:DEBUG' Name
+' ' Text
+']' Punctuation
+' ' Text
+'}' Punctuation
+'\n\t\t\t\t\t\t' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'$' Name.Variable
+'x:NBSP' Name
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'(:' Comment
+' ' Comment
+'e' Comment
+'x' Comment
+'p' Comment
+'o' Comment
+'r' Comment
+'t' Comment
+' ' Comment
+'b' Comment
+'u' Comment
+'t' Comment
+'t' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+':)' Comment
+'\n\t\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'input' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'type' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"button"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'title' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"export this session"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'onclick' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t\t' Text
+'concat' Name.Function
+'(' Punctuation
+'"list.exportServerSession(\'"' Literal.String.Double
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'id' Name
+',' Punctuation
+' ' Text
+'"\', this)"' Literal.String.Double
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'value' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"Export"' Literal.String.Double
+',' Punctuation
+' ' Text
+'(' Punctuation
+"' '" Literal.String.Single
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'id' Name
+')' Punctuation
+'[' Punctuation
+' ' Text
+'$' Name.Variable
+'d:DEBUG' Name
+' ' Text
+']' Punctuation
+' ' Text
+'}' Punctuation
+'\n\t\t\t\t\t\t' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'$' Name.Variable
+'x:NBSP' Name
+',' Punctuation
+'\n\t\t\t\t\t\t' Text
+'(:' Comment
+' ' Comment
+'o' Comment
+'n' Comment
+'l' Comment
+'y' Comment
+' ' Comment
+'s' Comment
+'h' Comment
+'o' Comment
+'w' Comment
+' ' Comment
+'d' Comment
+'e' Comment
+'l' Comment
+'e' Comment
+'t' Comment
+'e' Comment
+' ' Comment
+'b' Comment
+'u' Comment
+'t' Comment
+'t' Comment
+'o' Comment
+'n' Comment
+' ' Comment
+'i' Comment
+'f' Comment
+' ' Comment
+'t' Comment
+'h' Comment
+'e' Comment
+'r' Comment
+'e' Comment
+' ' Comment
+'a' Comment
+'r' Comment
+'e' Comment
+' ' Comment
+'n' Comment
+'o' Comment
+' ' Comment
+'c' Comment
+'o' Comment
+'n' Comment
+'f' Comment
+'l' Comment
+'i' Comment
+'c' Comment
+'t' Comment
+'i' Comment
+'n' Comment
+'g' Comment
+' ' Comment
+'l' Comment
+'o' Comment
+'c' Comment
+'k' Comment
+'s' Comment
+' ' Comment
+':)' Comment
+'\n\t\t\t\t\t\t' Text
+'element' Keyword
+' ' Text
+'input' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'type' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"button"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'title' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"permanently delete this session"' Literal.String.Double
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'onclick' Name.Variable
+' ' Text
+'{' Punctuation
+'\n\t\t\t\t\t\t\t\t' Text
+'concat' Name.Function
+'(' Punctuation
+'"list.deleteSession(\'"' Literal.String.Double
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'id' Name
+',' Punctuation
+' ' Text
+'"\', this)"' Literal.String.Double
+')' Punctuation
+' ' Text
+'}' Punctuation
+',' Punctuation
+'\n\t\t\t\t\t\t\t' Text
+'attribute' Keyword
+' ' Text
+'value' Name.Variable
+' ' Text
+'{' Punctuation
+' ' Text
+'"Delete"' Literal.String.Double
+',' Punctuation
+' ' Text
+'(' Punctuation
+"' '" Literal.String.Single
+',' Punctuation
+' ' Text
+'$' Name.Variable
+'id' Name
+')' Punctuation
+'[' Punctuation
+' ' Text
+'$' Name.Variable
+'d:DEBUG' Name
+' ' Text
+']' Punctuation
+' ' Text
+'}' Punctuation
+'\n\t\t\t\t\t\t' Text
+'}' Punctuation
+'[' Punctuation
+' ' Text
+'not' Name.Function
+'(' Punctuation
+'$' Name.Variable
+'conflicting' Name
+')' Punctuation
+' ' Text
+']' Punctuation
+'\n\t\t\t\t\t' Text
+'}' Punctuation
+'\n\t\t\t\t' Text
+'}' Punctuation
+'\n\t\t\t' Text
+'}' Punctuation
+'\n' Literal
+
+'\t' Literal
+'</' Name.Tag
+'form' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'\t' Literal
+'</' Name.Tag
+'outer' Name.Tag
+'>' Name.Tag
+'\n' Text
+
+'}' Punctuation
+'\n' Literal
+
+' ' Literal
+' ' Literal
+'<' Name.Tag
+'tr' Name.Tag
+'>' Name.Tag
+'<' Name.Tag
+'td' Name.Tag
+'>' Name.Tag
+'<!--' Literal.String.Doc
+' s' Literal
+'om' Literal
+'e ' Literal
+'co' Literal
+'mm' Literal
+'en' Literal
+'te' Literal
+'d ' Literal
+'th' Literal
+'in' Literal
+'gs' Literal
+'-->' Literal.String.Doc
+'&nbsp;' Literal
+'</' Name.Tag
+'td' Name.Tag
+'>' Name.Tag
+'</' Name.Tag
+'tr' Name.Tag
+'>' Name.Tag
+'\n' Literal
+
+'</' Name.Tag
+'html' Name.Tag
+'>' Name.Tag
+'\n' Text