That's fast work, but I don't think it's safe to take a keyword-based or
regex-based approach to highlighting XQuery. Try this:
let $let := <x>"test"</x>
return element element {
attribute attribute { 1 },
element test { 'a' },
attribute foo { "bar" },
fn:doc()[ foo/@bar eq $let ],
//x }
That's valid XQuery, but it messes up your highlighter in a couple of
ways. The quoted string inside the directly-constructed XML is treated
as if it is an XQuery quoted string. The element named "element" is
highlighted differently from the element named "test". It's possible to
patch each of these problems with progressively more sophisticated
regex, but it's also possible to find many more corner cases.
Ultimately, XQuery highlighting demands an XQuery parser.
I would also like to see highlighting of XPath expressions.
-- Mike
On 2010-09-16 22:23, Patrick Wied wrote:
> well here is my SyntaxHighlighter XQuery support solution
>
> http://www.patrick-wied.at/static/xquery/sh/
>
> hope you like it.
>
> best regards,
> patrick wied
>
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general