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?
Using xpath_eval in External Tool
-
- Posts: 707
- Joined: Wed Nov 16, 2005 11:11 am
Re: Using xpath_eval in External Tool
Hello,
There's a syntax error inside the XPath expression. The "if" condition must be between parentheses, like this:
I see that we log these a warning inside the console when there are exceptions with the XPath expression. Perhaps we should present that error directly inside the interface so that you understand what's wrong...
Best regards,
Alex
There's a syntax error inside the XPath expression. The "if" condition must be between parentheses, like this:
Code: Select all
if (true()) then upper-case('${system(os.name)}') else 'NOPE'
Best regards,
Alex
Re: Using xpath_eval in External Tool
Thanks,
Better reporting of such errors would indeed be welcome. I was looking for the Java Console (on Mac OS) but could not find it, or is this only accessible to developers?
- Michael
Better reporting of such errors would indeed be welcome. I was looking for the Java Console (on Mac OS) but could not find it, or is this only accessible to developers?
- Michael
Re: Using xpath_eval in External Tool
Hi,
If you start the .app launcher, the output of the console is redirected to the output.log and the errors to the error.log files kept in the Oxygen folder.
If you start the application via the .sh script in a Terminal, you will see the logged messages directly in the Terminal window.
Regards,
Adrian
If you start the .app launcher, the output of the console is redirected to the output.log and the errors to the error.log files kept in the Oxygen folder.
If you start the application via the .sh script in a Terminal, you will see the logged messages directly in the Terminal window.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com