commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tahir Akhtar" <ta...@spectrum-tech.com>
Subject [JXPath] Evaluating expressions with simple arithmetic expression
Date Fri, 31 Mar 2006 18:44:05 GMT
Hi,

I have a custom variable pool to a JXPath context.  Variables are named
A1,A2 … B1,B2 … and so on.

 

When I execute following code, I get the expected value.

 

Val=context.getValue(“$A1”);

 

But I try to evaluate something like this:

 

Val=context.getValue(“$B3-$B2”);

 

I get JXPath Exception: 

 

org.apache.commons.jxpath.JXPathException: Invalid XPath: '$B3-$B2'. Syntax
error after: '$B'

            at
org.apache.commons.jxpath.ri.Parser.parseExpression(Parser.java:60)

            at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.compileExpression(JX
PathContextReferenceImpl.java:218)

            at
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.getValue(JXPathConte
xtReferenceImpl.java:247)

Most of other expressions like those involving constants “2*2”,
sum(expression) are working correctly.

 

 

Is it possible to evaluate expressions like Val=context.getValue(“$B3-$B2”);
with JXPath

 

 

Waiting for all the helpful comments

 

Regards,

Tahir

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.3.3/298 - Release Date: 3/30/2006
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message