Problem using xpath_eval in transform scenario output tab

Having trouble installing Oxygen? Got a bug to report? Post it all here.
steve.cuzner
Posts: 72
Joined: Thu Mar 26, 2015 4:57 pm

Problem using xpath_eval in transform scenario output tab

Post by steve.cuzner »

Hi,

I've got an ant transform scenario that generates a report about the current project files. It runs fine, but I want to open the report when it's complete, so I put this in the Output tab Open field:

Code: Select all

${xpath_eval(concat('${pd}\', replace('${pn}', '_project', ''), '_report.xml'))}
If I remove the first concat argement,'${pd}\', it works fine, but the file won't open because it's trying to open relative to my current file which is in a sub-folder.
steve.cuzner
Posts: 72
Joined: Thu Mar 26, 2015 4:57 pm

Re: Problem using xpath_eval in transform scenario output tab

Post by steve.cuzner »

I should add that with ${pd}\ no document is opened and no error is presented. If I remove it I get a cannot open file error.
steve.cuzner
Posts: 72
Joined: Thu Mar 26, 2015 4:57 pm

Re: Problem using xpath_eval in transform scenario output tab

Post by steve.cuzner »

Using a simplified test, it appears that the $pd variable isn't being expanded or is causing some error. Given the following code:

Code: Select all

${xpath_eval(concat('${pd}', '\foo.xml'))}
which doesn't resolve to an actual file, I get no error message.

Changing only the internal variable,

Code: Select all

${xpath_eval(concat('${pn}', '\foo.xml'))}
which still resolves to a file that doesn't exist, I do get a file not found error.
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Problem using xpath_eval in transform scenario output tab

Post by Radu »

Hi Steve,

I found one way for you to debug this on your side.
If you edit the ANT transformation scenario, in the "Parameters" tab you can add a new parameter called for example "abc" and having as value:

${xpath_eval(concat('${pd}\', replace('${pn}', '_project', ''), '_report.xml'))}

Then run the transformation. Oxygen should expand the value and then show in the console view which pops up in the command line something like:

"-Dabc=D:\myProjects\samples\sample_report.xml"

So from what I tested on my side the ${pd} seemed to be properly expanded.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply