Using XML and XSLT file paths in Document Transformation Scenario

Here should go questions about transforming XML with XSLT and FOP.
LPiotr
Posts: 4
Joined: Thu Apr 22, 2021 11:58 am

Using XML and XSLT file paths in Document Transformation Scenario

Post by LPiotr »

I would like to set parameter for both user XML and XSLT files in Document Transformation Scenario.
Like in the situation below.
Document Transformation Scenario .jpg
Document Transformation Scenario .jpg (75.41 KiB) Viewed 1503 times
Using ${cf} only helps my with one file. I would like to work with both of them dynamically.

I read I and try to use https://www.oxygenxml.com/doc/versions/ ... ables.html but I could not find the answer.
tavy
Posts: 364
Joined: Thu Jul 01, 2004 12:29 pm

Re: Using XML and XSLT file paths in Document Transformation Scenario

Post by tavy »

Hello,


When you create a transformation scenario, you can use the editor variables such as ${cf} to specify dynamically the input XML or XSL. This means that you can use the same scenario for multiple files, and the editor variables will be expanded to the current file on which you apply the scenario.
But you can apply the scenario on the XML or on the XSL document, therefore you can use an editor variable such as ${cf} either to specify the input XML or the input XSL.
The other input (in your case the XSL) can be specified dynamically to the current file (in your case the XML), but you need to set maybe a different extension. For example you can use ${cfdu}/${cfn}.xsl, in case the XSL input has the same name as the XML input. You can use also ${xpath_eval(expression)} to process the input file name,
I don't know exactly you uses-case, and if the name of the input XML can be used also the input XSL. Maybe you can give me more details.
Another solution can be to define a custom editor variable. To create an editor variable, open the Preferences dialog box (Options > Preferences) and go to Custom Editor Variables. You can find more details in our user manual:
https://www.oxygenxml.com/doc/versions/ ... ables.html

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
LPiotr
Posts: 4
Joined: Thu Apr 22, 2021 11:58 am

Re: Using XML and XSLT file paths in Document Transformation Scenario

Post by LPiotr »

HI Tavy, thanks for answer.

My main problem is to not have to hardcoded the file name. The names change I don't want to set them every time.
I would like to have opportunity to dynamically choose the files from the oxygen.
Like with the select boxes above.

The best solution I think would be opportunity to use:
${dbgXML} - The local file path to the XML document that is currently selected in the Debugger source combo box (for tools started from the XSLT/XQuery Debugger).
${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).

By - https://www.oxygenxml.com/doc/versions/ ... ables.html

But they don't work with scenario, maybe custom editor variable is an answer.
tavy
Posts: 364
Joined: Thu Jul 01, 2004 12:29 pm

Re: Using XML and XSLT file paths in Document Transformation Scenario

Post by tavy »

Hello,

The ${dbgXML} and ${dbgXSL} were implemented as editor variables to be used in External Tools. They resolve to the selected XML and XSL/XQuery from the Debugger perspectives.
There is an issue on our internal issue tracker to support them also in the transformation scenario. I added your comment on the issue and increased its priority. We will update this thread when the i0ssue will be solved.
Thanks for your feedback.

Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply