Transformation Scenario ${xpath_eval} and regex

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Posts: 66
Joined: Fri Mar 08, 2013 8:58 am

Transformation Scenario ${xpath_eval} and regex

Post by whyme » Thu Nov 07, 2019 11:18 am

I am using editor variable ${xpath_eval} within a transformation output scenario Save As box, because I want to tweak the base uri of the input before sending it to output. But when I do something like this...

Code: Select all

...I get an error. The line has been interpreted as asking for the file to be saved at `${pd}/${base-uri()}` (if such an editor variable existed). When I open up the transformation scenario I see that the formula has been changed to this...

Code: Select all

It works fine if I change \w to something like [a-zA-Z0-9].

I assume that oXygen is normalizing path separators. Is there any way to exempt backslashes that are in an {$xpath_eval}?

Posts: 763
Joined: Wed Nov 16, 2005 11:11 am

Re: Transformation Scenario ${xpath_eval} and regex

Post by alex_jitianu » Thu Nov 07, 2019 3:59 pm


Thank you for reporting this issue. We will send you a notification as soon as it gets fixed and a new build containing the fix is released. Until then, perhaps you can tweak the regular expression a bit, replacing that backslash with a different construction. If I understand it correctly, you want to keep just the first word from the file name. An [^abc] construction could work, if there are certain patterns that your files usually have:

Code: Select all

replace(base-uri(),'.+/([^/. -_]+).+','$1')
Best regards,

Posts: 6987
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transformation Scenario ${xpath_eval} and regex

Post by Radu » Wed Feb 19, 2020 8:17 am


Just to update this thread, the problem was fixed in Oxygen version 22.

Radu Coravu
<oXygen/> XML Editor

Post Reply