xpath eval in Transformation Scenario

Oxygen general issues.
Garrett_3
Posts: 9
Joined: Fri Feb 12, 2021 8:46 pm

xpath eval in Transformation Scenario

Post 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!
Garrett
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: xpath eval in Transformation Scenario

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Garrett_3
Posts: 9
Joined: Fri Feb 12, 2021 8:46 pm

Re: xpath eval in Transformation Scenario

Post by Garrett_3 »

This worked great.

Thanks Radu :D
Garrett
Post Reply