rraguso / ajaxslt

Automatically exported from code.google.com/p/ajaxslt
Other
0 stars 0 forks source link

xpathParse fails to reduce 'RelativeLocationPath * FunctionCall' #26

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Evaluate an expression of the form: ../principal * instance('rate')
('instance' is an XPath function specific to XForms but any function call 
will exhibit the same behavior). The inverse, FunctionCall * LocationPath, 
will fail as well.

What is the expected output? What do you see instead?
The expected output is the value of the node selected by the location expr 
multiplied by the result of the function call expr. The actual result is 
an xpath parse error because the stack contains two Expr objects.

What version of the product are you using? On what operating system?
ajaxslt-0.8.1, Windows XP.

Please provide any additional information below.
The Ubiquity XForms project is using ajaxslt and this issue was discovered 
using one of our sample forms. The relative location path is fully reduced 
to an Expr but there is no rule for an Expr followed by TOK_ASTERISK and 
the asterisk is lost. The following function call is also fully reduced to 
an Expr but now you have two Expr objects left on the stack.

Adding the rule: [ XPathExpr, [ XPathExpr, TOK_ASTERISK], 0, passExpr, 
ASSOC_LEFT ] to xpathGrammarRules solved the problem for us. A patch with 
that one simple change is attached.

Original issue reported on code.google.com by merle.st...@gmail.com on 28 Aug 2008 at 7:16

Attachments: