1.7 5624 Probable error in msg from bad xpath expansion
I am adjusting some of the derived expressions. When I make an error I get a message like:
Invalid XPath: 'concat(expr:if(count(openvpms:get(.,\'prescription.source.dispensing\'))>0,\' *P \'),openvpms:get(.,\'product.entity.name\'), \' - Qty: \',/details/quantity,expr:if(boolean(/details/label),concat(\'\n\',/details/label,\'\n\'),\'\'),expr:if(boolean(/activityEndTime), concat(\'Expiry: \', date:formatDate(/activityEndTime), \' \'))'. Syntax error after: 'c'
Note the last part "Syntax error after 'c'"
Is it possible to improve the 'after' information - for example by providing a position count.
I also have my suspicions about the validity of the "after 'c'" - the actual error in the above expression is that there is a missing bracket at the end - ie the initial concat( has no closing bracket.
Also If I remove the quote after the "perscription.source.dispensing" (so that we have an unterminated quote string) then the error is still "after 'c'".
Hence I have a suspicion that the 'c' is erroneous.
Regards, Tim G
Re: 1.7 5624 Probable error in msg from bad xpath expansion
This error message is coming from the jxpath Parser class. The context information is lost when it catches and rethrows the original exception.
It may be possible to catch the JXPathInvalidSyntaxException and re-parse the expression using the underlying XPathParser class to get more information.
Try writing a test class that re-implements Parser, and feed the above expression into it and see if you can get the output you want.
Re: 1.7 5624 Probable error in msg from bad xpath expansion
Tim - I will have a play with this when things have quietened down [ie we have accomplished the switch from RxWorks and OPV is running happily]
Regards, Tim G