Working directory of a framework-based xquery script

Post here questions and problems related to oXygen frameworks/document types.
afuchs
Posts: 24
Joined: Mon May 19, 2014 11:38 am

Working directory of a framework-based xquery script

Post by afuchs »

Good day,

I am developing a framework for a project that contains around 2000 XML files tucked into different subdirectories of the project.
The framework must include a variety of xquery scripts to generate different kinds of reports, indexes etc. for this data, i.e. cull information from the collection of files, pack it up as an XML and present it in a tab, where it can be used and processed in the same framework. The scripts should be accessible as author actions / buttons on the toolbar.

My difficulty is to pass the project directory to the xquery script, which I have included in the framework as a "transformation scenario". The configuration of the scenario allows either a specific file as input, or nothing. In the latter case, the working directory is the directory of the framework resource (doesn't help me), in the former case the working directory may be any of the subdirectories of the project (complicated).

My workaround at present is placing a dummy file in the project directory and naming it as input, then extricating its path. This is somewhat inconvenient.

Using parameters is difficult because the project is distributed to users who may put it anywhere in their environments. But there is always a project with an XPR file along with it.

Is there a more straightforward way to pass the project directory to a transformation scenario in aframework?