Re: [basex-talk] Getting element counts in the visualizations?

2016-02-18 Thread Steinar Bang
> Christian Grün : >> And what I'm actually looking for in this case, is a list of the top >> level element names ("A" and "B" in my example) together with a count of >> their children. > Try e.g. one of these two queries: > • count(//A/*), count(//B/*) Those

Re: [basex-talk] Setting base-dir for xquery:eval

2016-02-18 Thread Andy Bunce
Hi Christian, I have used this technique and it works unless the query string already has a base-uri set. I wonder if there is a case for adding base-uri to the xquery:eval options map to handle this in a cleaner way? /Andy On 19 Feb 2016 07:10, "Marc van Grootel"

Re: [basex-talk] Setting base-dir for xquery:eval

2016-02-18 Thread Marc van Grootel
Yes, exactly what I was after. Thanks and good night :) --Marc > On 18 feb. 2016, at 23:38, Christian Grün wrote: > > Hi Marc, > >> when running xquery:eval with a string it will try to resolve paths >> relative to the code module and not relative to the file the

Re: [basex-talk] Sending Bytes, Not Strings, To BaseX Using the Ruby Client

2016-02-18 Thread Christian Grün
Hi Eliot, For most client bindings, files must indeed be sent in UTF-8, so I guess it’s also the case for the Ruby binding. If the sent bytes are correct UTF-8, everything should work be fine. Christian On Thu, Feb 18, 2016 at 6:08 PM, Eliot Kimber wrote: > This test

Re: [basex-talk] Setting base-dir for xquery:eval

2016-02-18 Thread Christian Grün
Hi Marc, > when running xquery:eval with a string it will try to resolve paths > relative to the code module and not relative to the file the string > came from. You could add a base-uri declaration in your query: let $uri := 'a/b/c' let $query := '1' return xquery:eval( 'declare

Re: [basex-talk] Getting element counts in the visualizations?

2016-02-18 Thread Christian Grün
> And what I'm actually looking for in this case, is a list of the top > level element names ("A" and "B" in my example) together with a count of > their children. Try e.g. one of these two queries: • count(//A/*), count(//B/*) • for $c in /Top/* return count($c/*) > Hm... I selected a second

Re: [basex-talk] Getting element counts in the visualizations?

2016-02-18 Thread Steinar Bang
> Christian Grün : Hi Christian, thanks! > If you want to know the number of child elements from the root > elements, you could run a simple XPath expression via the input bar > [2] or editor panel [3] after opening the database: > count(/*/*) That only gives

[basex-talk] Setting base-dir for xquery:eval

2016-02-18 Thread Marc van Grootel
Hi, I am having quite some fun with xquery:eval. I am working on a little module for executable documentation (similar to Python doctest). I want to write documentation in asciidoc, parse it and execute source code blocks inside the asciidoc. Parsing works by calling asciidocj and so far I can

Re: [basex-talk] Getting element counts in the visualizations?

2016-02-18 Thread Christian Grün
Hi Steinar, Thanks for your mail. > What I needed from BaseX was finding the size of the contents of the > second level elements (ie. the elements immediately below the root > element). If you want to know the number of child elements from the root elements, you could run a simple XPath

[basex-talk] Getting element counts in the visualizations?

2016-02-18 Thread Steinar Bang
Platform: Intel i7 Windows 7 Enterprise BaseX 8.4 Today I opened an 80MB XML file in the BaseX GUI, and I was amazed at the speed of BaseX, compared to e.g. trying to open, count, and extract stuff from the same file in emacs. What I needed from BaseX was finding the size of

Re: [basex-talk] Sending Bytes, Not Strings, To BaseX Using the Ruby Client

2016-02-18 Thread Eliot Kimber
This test document as a non-ascii character '〺' (\u303A), which I added to test handling of multi-byte characters. Ruby and the BaseX client seem to be handling the UTF-8 correctly but UTF-16 didn't. I'm guessing it's Ruby's fault because it's treating the bytes as a string and of course that's

Re: [basex-talk] Sending Bytes, Not Strings, To BaseX Using the Ruby Client

2016-02-18 Thread Eliot Kimber
I turned my UTF-8 file into a UTF-16 file and trying to commit it to BaseX via the Ruby client it did not work: BaseXClient.rb:50:in `execute': Resource "/opt/basex/?" not found. (RuntimeError) Where "?" is some kind of "unrecognized character" indicator Cheers, E. Eliot Kimber, Owner

[basex-talk] Sending Bytes, Not Strings, To BaseX Using the Ruby Client

2016-02-18 Thread Eliot Kimber
I'm implementing server-side git hooks for use in GitLab under Docker where Java is not available (at least that I can see). The hooks load or delete files from databases in BaseX. I'm trying to implement the hooks in Ruby (which is much more pleasant than bash scripting in any case) and I'm