Page 1 of 1

xpath eval in Transformation Scenario

Posted: Mon Feb 05, 2024 7:37 pm
by Garrett_3
Hello,

I am trying to use the xpath_eval editor variable to find and use an attribute value in the naming of output files for a transformation scenario.

I am using these variables/expressions/text ${cfd}/${xpath_eval(doc('${cf}')//manual/@fleet)}.pdf but it doesn't seem to work. Any advice?

Image:
https://drive.google.com/file/d/1u0F08K ... fk3We/view

Thanks!

Re: xpath eval in Transformation Scenario

Posted: Tue Feb 06, 2024 8:59 am
by Radu
Hi Garrett,
So according to our docs:
https://www.oxygenxml.com/doc/versions/ ... ables.html

Code: Select all

${cf} - Current file as file path, that is the absolute file path of the currently edited document.
meaning that it expands to a file path like:

Code: Select all

D:\path\to\abc.xml
But the XSLT doc() function needs an URL like path as a parameter like:

Code: Select all

file:/D:/path/to/abc.xml
So I would suggest that instead of ${cf} you use ${currentFileURL}.
Also if that "manual" element is in a namespace use "*:manual" to match it with the xpath.
Regards,
Radu

Re: xpath eval in Transformation Scenario

Posted: Tue Feb 06, 2024 6:34 pm
by Garrett_3
This worked great.

Thanks Radu :D