Implementation

The code runs under BaseX 9.2, and currently no XSLT is used by the built-in renderers.

For parsing XQuery and xqDoc comments, the ex-xparse component [18] is used. This component is a REX based parser. ex-xparse is modelled on John Lumley's proposal for an XParse Module [XPARSE]. It can parse a number of XQuery versions and dialects.

The rendering code is:

      for $render in $global
      let $doc:= apply($render?function,[$model,$opts])
      return map{"document": $doc, 
                 "uri": $render?uri, 
                 "output":$xqo:outputs?($render?output)
               },
               
      for $render in $module, $file in $model?files
      (: override opts for destination path :)
      let $opts:=map:merge((
            map{
              "root": "../../",
              "resources": "../../resources/"
            }, $opts))
      let $doc:= apply($render?function,[$file,$opts,$model])       
      return map{"document": $doc, 
                 "uri": concat($file?href,"/",$render?uri),  
                 "output": $xqo:outputs?($render?output)
                }
              )