mbrevoort/CodeMirror2 — Issue #15: incorrect highlighting when xquery code wrapped inside xml node
Author: clockworked247
Created: 2011-11-29 19:48:33+00:00
State: open

The second through nth FLOWR statements are not highlighted correctly in the sample below.

xquery version "1.0-ml";
declare namespace bt="http://cerisent.com/bugtrack";
declare namespace local="local";
declare default collation "http://marklogic.com/collation/codepoint";

declare function local:asdf($name as xs:string, $parent-query as cts:query) {
for $ev in cts:element-values(xs:QName($name), (), (), $parent-query)
return element group {
attribute value {
$ev
},
cts:frequency($ev)
}
};
(:
{
local:asdf("bt:category", cts:and-query(()))
},
:)

{
let $q := cts:and-query((
cts:element-value-query(xs:QName("bt:submitted-by"), "jmakeig"),
cts:field-value-query("to-be-fixed-in-versions", "5.0-1"),
cts:element-value-query(xs:QName("bt:status"), ("new", "verify", "fix", "external"))
))
(: categories :)
for $c in cts:element-values(xs:QName("bt:category"), (), (), $q)
return {
let $q2 := cts:and-query((
$q,
cts:element-value-query(xs:QName("bt:category"), $c)
))
(: categories > versions :)
for $v in cts:field-values("to-be-fixed-in-versions", (), (), $q2)
return {
let $q3 := cts:and-query((
$q2,
cts:field-value-query("to-be-fixed-in-versions", $v)
))
(: categories > versions > assigned-to :)
for $at in cts:element-values(xs:QName("bt:assigned-to"), (), (), $q3)
return {
let $q4 := cts:and-query((
$q3,
cts:element-value-query(xs:QName("bt:assigned-to"), $at)
))
for $s in cts:element-values(xs:QName("bt:status"), (), (), $q4)
return {cts:frequency($s)}
}
}
}
}