create xqDoc with XML Editor/Developer

Oxygen general issues.
Posts: 19
Joined: Mon Sep 13, 2021 10:41 am

create xqDoc with XML Editor/Developer

Post by larsS »

I've come across a problem. I wanted to create an xqDoc from an XQuery script (xq), but it showed errors parsing the “|” character (to concatenate text “||”) the first time I tried and then after I replaced everything with the fn:concat function, it had a problem parsing the parentheses correctly for functions given as parameters. "Unexpected Token..." Error
The xqDoc website has not been maintained since probably 2013. In addition, although there is an xqDoc Antlr4 implementation so that an external jar can possibly be accessed, unfortunately this does not seem to be fully compatible with XQuery 3.0 or 3.1 either.


Code: Select all

xquery version "3.1";

 : Scan a collection tree recursively starting at $root. Call $func once for each collection found
 : in the tree.
 : @param $root Root collection URI
 : @param $func The function to call is local:scan-resources
 : @return The collections found in the given collection path recursively
 : @called from local:scan#2 and self
declare function local:scan-collections($root as xs:anyURI, $func as function(xs:anyURI) as item()*) {
    if (sm:has-access($root, "rx")) then
        for $child in xmldb:get-child-collections($root)
            local:scan-collections(xs:anyURI(concat($root, "/", $child)), $func)
local:scan-collections(xs:anyURI("/db/"), function ($collection) {
    if ($collection ne '') then
        (: do something :)
Some references:

Maybe I have not understood the basic aspects and it is only possible to read only modules (at least that is the case with eXist) in xqDoc and the “local” namespace is not valid and therefore it does not recognize the functions correctly, but oXygen XML detects "xq" files as possible parsable or at least these endings are offered as possible entries.

But if someone knows a possible solution, hint or even tools, I would be very grateful.