Page 1 of 1

Problem using xpath_eval in transform scenario output tab

Posted: Mon Feb 05, 2018 10:00 pm
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.

Re: Problem using xpath_eval in transform scenario output tab

Posted: Mon Feb 05, 2018 10:34 pm
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.

Re: Problem using xpath_eval in transform scenario output tab

Posted: Tue Feb 06, 2018 12:44 am
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.

Re: Problem using xpath_eval in transform scenario output tab

Posted: Tue Feb 06, 2018 11:38 am
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