Can I use Oxygen variables with custom refactoring descriptor file?

Oxygen general issues.
dnl
Posts: 14
Joined: Tue Aug 28, 2018 3:51 pm

Can I use Oxygen variables with custom refactoring descriptor file?

Post by dnl »

https://www.oxygenxml.com/doc/versions/ ... iptor.html

I want to make the path of the current XML file available to the XQuery update script in my custom refactoring operation.

Is it possible to pass ${cfdu} in the descriptor file?
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Can I use Oxygen variables with custom refactoring descriptor file?

Post by Radu »

Hi,

Right now it is not possible to pass an Oxygen editor variable as a parameter value to the script and have the editor variable automatically expand before being sent to the script, we do have plans for this and I will update this forum thread when this feature becomes available.
About your particular request, why don't you use the "document-uri()" XQuery function for it?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dnl
Posts: 14
Joined: Tue Aug 28, 2018 3:51 pm

Re: Can I use Oxygen variables with custom refactoring descriptor file?

Post by dnl »

Thanks, this would be a great enhancement.

As a workaround I will use document-uri(), but I wanted to avoid having to use function chaining like replace(document-uri(),tokenize(document-uri(),'/')[last()],'') (is there a simpler way for saying "give me the path of the current file"?)

Thanks!
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Can I use Oxygen variables with custom refactoring descriptor file?

Post by Radu »

Hi,

Right, maybe for now you can create a separate XQuery function to obtain the parent folder URL for the current file and then import and use that function in multiple XQuery scripts.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
EmmeTi
Posts: 2
Joined: Fri Dec 28, 2018 3:47 pm

Re: Can I use Oxygen variables with custom refactoring descriptor file?

Post by EmmeTi »

More thanks for the info, it helped me
Post Reply