Back-to-school XQuery Syntax Bounties

by Eric Bloch

September is back-to-school month. In recognition of the joy of learning, we're offering up some enticements for MarkLogic and XQuery community folk to go learn something new (or for some, re-visit something old).

I've listed a handful of open-source syntax-highlighting projects below that are missing support for XQuery. And attached to them, you'll see listed rewards (Apple iPads, O'Reilly online book subscriptions) that can be claimed by producing the missing piece(s) of code that would benefit our community. 


Name Summary Bounty
Github Github is lacking support for XQuery.  They use Pygments (a python framework for syntax highlighting) and need a Pygments Lexer. See this brief note.

Apple iPad
64GB w/ WiFiApple iPad 64GB with WiFi

Codemirror Codemirror is a javascript library that provides in-browser syntax highlighting.  It is missing support for XQuery.

Apple iPad
64GB w/ WiFiApple iPad 64GB with WiFi

Google Code Google Code uses google-code-prettify and it is missing support for XQuery.  A first step here would be to provide a patch that supports these.  Bonus points would be to get the project to take in the patch.

Apple iPad
64GB w/ WiFiApple iPad 64GB with WiFi

SyntaxHighlighter Popular open-source Javascript syntax highlighter. 1 year subscription tosafari
GNU Source-highlight GNU C++ highlight library
1 year subscription tosafari

There are some helpful starting points, too.  The following tools do have XQuery support:

If you're interested, read on.  The process of claiming a bounty is relatively simple.  

  1. Let us know you're going to work on it by sending an email to the MarkLogic developer list with the words "bounty hunting" in the subject and your name and the specific bounty in the body of the email.  At that time, we also recommend your searching through the list to see if anyone else is working on claiming your bounty. 
  2. When you're done, send a note to the MarkLogic developer list with a pointer to the code, docs, and any other relevant artifacts.   
  3. Entries will be judged on completeness, accuracy, quality, and other standard metrics for software tools. At the end of the month of September, we'll evaluate all entries and choose a winner for each bounty.  In the event of a tie, the entry that was received first wins.  Judges' decisions are final.
  4. Everyone (including MarkLogic employees, but excluding me) is eligible to participate.
  5. Bounties unclaimed at the end of the month may roll over to the following month.

Help us out and go claim your reward!


  • I'm embarrassed to say that I'm behind in evaluating the entries. I expect to announce results <em>soon</em>, but can't promise a specific date.
    • Any news on this? Or at least an updated list of XQuery friendly highlighters?
      • Hey, sorry for not updating this thread. I posted the "takedowns" on this blog a while ago at
  • Have any results been announced yet?
  • I emailed Alex and submitted the brush but never heard anything :( <a href=""></a> You're right about Bespin - it's had a long and frustrating history, but I'm hopeful that's behind them now. For DQ I'm just going to use the embedded editor, but it would be interesting to look at writing a server plugin for MarkLogic to get the full capabilities of Bespin (sorry Skywriter...)
  • Thanks, Rob!   I did manage to reference <a href="">people talking</a> about support in <a href="/code/DQ">DQ</a> in the link above, but I didn't find your brush when I searched for XQuery syntax highlighters. Your brush isn't in the "<a href="">long list</a>" of brushes; did you offer to contribute it to Alex's project?  Even though you haven't followed the instructions above, I'll treat this as the first entry we've received for the <a href="">SyntaxHighlighter</a> bounty, assuming you're interested in it.  Just drop me a line at our <a href="">developer list</a> so I know you're interested. As to Bespin, I've followed that project on and off over some of it's history.  Sometimes I've been excited, other times disappointed.  I'll take another look.
  • Here's an implementation of xquery (plus ML 4 extensions) for SyntaxHighlighter I wrote about a year ago: <a href=""></a> All the code snippets on my blog use it. Also it's a shame you didn't include Bespin/Skywriter in the bounty, it's by far the most advanced web based code editor I know of, and I happen to be in the process of including it in DQ :)
  • Ah, I thought that was ringing a bell--thanks very much...
  • Thanks, Brett.  <a href="">SHJS </a>uses <a href="">GNU Source-highlight</a> so, in theory, most of the work would be done there.  And we've already listed that one above.
  • Awesome idea! Could you also consider <a href=""></a> ? I found it convenient for use in my "Color Source" Thunderbird email add-on, to allow syntax coloring within emails:  <a href=""></a>
  • Thanks, David. I'll consider GeSHi for future bounties.
  • Here is some detailed documentation about the XQuery language (including XPath) that may/may not be useful in highlighting: <a href=""></a> For writing a lexer it is really helpful because it describes all the states.
  • Another syntax highlighter that could use XQuery support is GeSHi - Generic Syntax Highlighter (<a href=""></a>). It is the syntax plugin used for example by DokuWiki.