Hello,
In the scenario window I could only find variables for the current file and the current dbgXSLT, but nothing to reference a current XQUERY.
In what context did you find dbgXSL mentioned? Maybe in the
documentation?
Despite the name, dbgXSL also resolves to the debugged XQuery.
${dbgXSL} - The local file path to the XSL/XQuery document that is currently selected in the Debugger stylesheet combo box (for tools started from the XSLT/XQuery Debugger).
The bad news is
dbgXSL is only available for External Tools that are started in the Debugger perspectives. It is not available for transformation scenarios. I've added an improvement request to discuss if it makes sense to accommodate dbgXML and dbgXSL in scenarios, since scenarios aren't really meant for the debugger perspective.
I have hundreds of XMLs and hundreds of XQuery & XSLTs analysis-functions, and I can't (i.e. don't want to have to) create a scenario every time I want to do an analysis on some XML file
You only need one scenario that can be reused/edited, but since what you apply with it is fixed, it should be created so that
${currentFileURL} is the file that most frequently changes (e.g. XML), and only change the XQuery.
So, if you have an XQuery that you want to run on many XMLs, open an XML and create a scenario of type "
XML transformation with XQUERY", leave the "XML URL" set to
${currentFileURL} and pick the XQuery. If the XQuery document is open, you can quickly select it from the combo list.
So, you can now use this scenario to apply the selected XQuery on any open XML. You may want to use the
Transformation Scenarios view (Window > Show View > ...) to easily select and run the scenario from the list.
When you want to apply a different XQuery, open that XQuery, select back an XML, select and edit the reusable scenario (Edit button in
Transformation Scenarios view toolbar) and pick from the XQuery URL combo list your newly opened XQuery. Once you get used to it, it takes maybe 3-4 clicks to change the XQuery from the scenario.
I have for the moment made an (unsatisfactory) workaround, that I always place the file I want to analyse in a particular path, and then run the sceanrio to apply the currently selected xquery to it.
You seem to have already tried the opposite, a scenario from the XQuery perspective, "
XQuery transformation " with "XQuery URL" set to
${currentFileURL} and you keep changing the XML. Wouldn't it be simpler to edit the scenario and select the XML from the scenario combo list, rather than moving the XML to a specific location?
Transformation scenarios are meant to work "1 to many", 1 specific XSLT/XQuery to many XMLs, or the opposite, 1 specific XML to many XSLT/XQuery. They can also be used in batch transformations (select a folder or multiple files in the Project view, right click and see
Transform submenu), if that's of any use to you.
Other than that, I don't have a proper solution for such use case.
The debugger is the fastest way of picking both files, but is the slowest to run, as it is quite heavy. Use the
"Link with Editor" option (to the right of the XQuery combo list), so that the currently selected editors are automatically picked as XML and XQuery inputs. Use Run to End (Alt-F5) to run it without stopping.
Regards,
Adrian