Using xpath_eval in External Tool
Oxygen general issues.
-
- Posts: 14
- Joined: Tue Jan 19, 2016 5:55 pm
Using xpath_eval in External Tool
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?
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: Using xpath_eval in External Tool
Post by alex_jitianu »
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
-
- Posts: 14
- Joined: Tue Jan 19, 2016 5:55 pm
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
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
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
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service