ligasgr / intellij-xquery

Plugin to support XQuery in Intellij Idea
Apache License 2.0
35 stars 23 forks source link

Indentation in Run window using BaseX (native embedded) #210

Closed CanOfBees closed 7 years ago

CanOfBees commented 7 years ago

Hi, I'm in the habit of trying to use the Run feature as a sort of REPL-ish interface, but I was recently working with it and trying to visually parse a lengthy results for certain elements. Is there a way to get indentation working in the Run window using BaseX (native embedded). I have the following XQuery:

(: output namespace declared explicitly for saxonHE-9 test :)
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";

declare option output:method "xml";
declare option output:indent "yes";
declare option output:encoding "UTF-8";

let $test :=
  <a>
    <b>test b</b>
    <b>test b, 2
      <c>nested test</c>
    </b>
    <b>again...</b>
  </a>
return
  $test

when I set up a Run configuration using the native embedded option for BaseX, using the following user-defined drivers/JARs:

basex-api-8.6.1.jar
basex-xqj-8.6.jar
xqj2-0.2.0.jar
xqj-api-1.0.jar
BaseX.jar

I get the following results:

<?xml version="1.0" encoding="UTF-8"?><a><b>test b</b><b>test b, 2
      <c>nested test</c></b><b>again...</b></a>

Process finished with exit code 0

vs using a BaseX Run configuration that talks to a DB or Saxon, whose results look like this:

<a>
  <b>test b</b>
  <b>test b, 2
      <c>nested test</c>
  </b>
  <b>again...</b>
</a>
Process finished with exit code 0

Is this a limitation with the XQJ API or potentially something else that I'm misconfiguring? I'd be happy to share the run configurations that I'm using - I'll need to try to remember how to share them. Thanks for any guidance you can provide, and thanks for the plugin!

PS I sent you some email at your gmail account recently - any thoughts on it, should I resend, or alternately I don't mind discussing the topic here.