Using xpath_eval in External Tool
Posted: Thu Apr 04, 2019 2:09 pm
Hi all,
I want to make a call to an external tool OS independent, and because it is either a BAT or a SH file, I thought of using $xpath_eval() to check out os.name for differentiation. I tested the behavior inside the $ask editor variable.
After some testing, I think that "if … then … else …" is not supported in the XPath expression.
This works, i.e. the default value is filled:
[Codebox=]${ask(
'${system(os.name)}',
generic,
'${xpath_eval(
upper-case('${system(os.name)}')
)}'
)}[/Codebox]
This does not work, i.e. the default value is empty but should be the same:
[Codebox=]${ask(
'${system(os.name)}',
generic,
'${xpath_eval(
if true() then upper-case('${system(os.name)}') else 'NOPE'
)}'
)}[/Codebox]
What have I got wrong?
I want to make a call to an external tool OS independent, and because it is either a BAT or a SH file, I thought of using $xpath_eval() to check out os.name for differentiation. I tested the behavior inside the $ask editor variable.
After some testing, I think that "if … then … else …" is not supported in the XPath expression.
This works, i.e. the default value is filled:
[Codebox=]${ask(
'${system(os.name)}',
generic,
'${xpath_eval(
upper-case('${system(os.name)}')
)}'
)}[/Codebox]
This does not work, i.e. the default value is empty but should be the same:
[Codebox=]${ask(
'${system(os.name)}',
generic,
'${xpath_eval(
if true() then upper-case('${system(os.name)}') else 'NOPE'
)}'
)}[/Codebox]
What have I got wrong?