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 base-uri "' || $uri || '"; ' || $query
  )

Does this help?
Christian


> Ideally I would like to be able to set the base-dir for
> xquery:eval. The asciidoc file isn't always in the correct path
> relative to the module that I need to import.
>
> Other options I'm considering but are less ideal.
>
> - Manipulate the module import paths in the query string using regexps
> - Writing out to a temp file and then use xquery:parse-uri (but this
> is tricky as I may not want to clutter existing directories with
> tempfiles only to have the imports work).
>
> Unless there are better options I think I'll opt for string massaging
> using regexps. But maybe someone has a better idea.
>
> --Marc

Reply via email to