[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Editing/evaluation of code blocks

From: Nicolas Goaziou
Subject: Re: [O] Editing/evaluation of code blocks
Date: Mon, 09 May 2016 22:08:39 +0200


Norman Walsh <address@hidden> writes:

> I’ve started using Org Mode more frequently and I thought it would be
> fun to extend org-babel support to evaluate XQuery, JavaScript, and
> SPARQL code blocks by sending them off to MarkLogic server.
> I was right, it was fun :-)
> If I type C-c C-c in this block:
> #+begin_src marklogic :var startDate="2017-04-19T12:34:57"
>   xquery version "1.0-ml";
>   declare default function namespace "http://www.w3.org/2005/xpath-functions";;
>   declare option xdmp:mapping "false";
>   declare variable $startDate external;
>   let $date   := $startDate cast as xs:dateTime
>   let $diff   := current-dateTime() - $date
>   return
>     current-dateTime() - $date
> #+end_src
> I get back a result!
> : -P348DT10H59M31.387138S
> Win!
> But C-c ' fails because “marklogic-mode” isn’t the mode for editing
> XQuery. There’s an xquery-mode for that.
> I found org-src-lang-modes which allows me to make ‘marklogic’ use
> xquery-mode, except that that’s wrong when I’m editing JavaScript
> or SPARQL. :-(
> Is there some way, in the source block itself, to specify
> *independently* the mode that should be used to edit and the language
> package that should be used for evaluation?
> Guessing not, I considered refactoring the code to support ‘xquery’,
> ‘javascript’, and ‘sparql’ languages.
> That would be fine, but I presume there are (or will eventually be)
> other backends for evaluating these languages. Maybe the answer then
> is simply not to load two different ones at the same time, but that
> doesn’t seem very satisfying.

I may be wide off the mark, but could you introduce marklogic-xquery
marklogic-js marklogic-sparql instead?


Nicolas Goaziou

reply via email to

[Prev in Thread] Current Thread [Next in Thread]