http://github.com/robwhitby/DQ
Here’s a very early version of a new interface to CQ that I’m slowly working on, imaginatively named DQ. It aims to address a number of shortcomings in CQ, the web XQuery interface provided by Mark Logic.
Current features
Tabbed code editor (based on EditArea) with XQuery syntax highlighting, search and replace, and support of tab key
Save queries and results to file system
Auto-save of all query tabs using browser local storage (no more session confusion)
Highlighting a section of code and executing will run just the selected code (inspired by SQL Query Analyzer!)
Future features
Integration of XQuery API reference
Function auto-complete
More suggestions welcome!
Requirements
Recent version of CQ installed (I’m using 4.1.2)
Firefox 3.5 or IE8 (Chrome doesn’t style XML output, Safari and Opera not yet tested)
Installation
Unzip DQ folder in root of your CQ directory
Browse to: http://SERVER:CQPORT/DQ
The project is up on sourceforge:
https://sourceforge.net/projects/mldq/
Please give it a go and let me know what you think. I’d be interested in suggestions on improvements, extra features etc.

I only played with it for a few minutes, but my initial impression is that it is a nice addition. The ability to rename the tabs would be nice (unless you can and I overlooked it). Very nice work though. Thanks for sharing.
By the way, it mostly works in Safari (Mac) from what I can tell except that when you execute your query using the “xml” button Safari doesn’t display the xml to the page, only the values.
Would be great to see the “explore” button implemented somewhere too. As well as the history.
The edit area is a great addition though.
nice.
Thanks for your comments, good to know there’s some interest in it!
Paul – I never use the explore or history options in CQ, so didn’t really consider them important. I’ll think about how they could be included though. I definitely see scope to improve on CQ’s browse interface.
Travis – renaming tabs is on the to-do list, and for rendering xml in Safari and Chrome I’ll look at a workaround, maybe by applying a client-side XSL transform.
Great tool, well done Rob!
It doesn’t work in Opera 10.10 right now, it would be great if you could allow DQ to support this.
Opera has a decent XML renderer which highlights elements and attributes quite well. It also includes namespace declarations (unlike Firefox).
I’ve uploaded an update to sourceforge that works in Opera 10.10.
http://sourceforge.net/projects/mldq/
The auto-saving of tabs relies on window.localStorage which I don’t think is in Opera until 10.5.
Thanks for your feedback
Rob
Hey Rob,
Great Job, You beat me to the punch I was just starting to my own CQ implementation using EditArea syntax editor. Some of the customization features I was added was comment toggling, autocomplete and session switching. Keep up the good work.
Regards,
GV
Pingback: Commandline interface for XQuery « XQuery Web Application Development
Great job Rob…Well Done !! I like the feature where you can select an xquery and execute without the need of commenting others.
Hello Rob,
Is it possible to re-name the individual documents that we open in DQ ?
Thanks,
Sekhar.
Hi Chandra, not right now but it is planned for the next version which I’m hoping to get a chance to work on in November.
I’ve run a poor query or two which returned too much data crashing my browser. In at least one case the tab showed (*) as if the query had been edited, but not saved to local storage. When I re-opened dq, my work had not been saved.
Is there anyway to force tabs to save to local storage? When does auto-save happen?
Hi Curtis,
The tabs are saved on exit, so if the browser crashes this won’t happen.. I’ll change it in future versions to save when executing a query.
Thanks for your feedback,
Rob
Just writing to say: Thanks!
A co-worker showed me this after I’d been using cq for a few weeks. Very nice!
The only thing missing for me would be to name tabs (as others have commented).
CQ’s explore is useful, but I like just using CQ for that, and DQ for queries.
Hi Colin,
Glad you find it useful! Tab renaming and explore are both now supported – download the latest version (0.2) from github
Thanks,
Rob