RE: Simplified production for FilterExpr in XPath spec?

Subject: RE: Simplified production for FilterExpr in XPath spec?
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 18 Jul 2000 09:04:27 +0100
> The production in the XPath spec for FilterExpr is:
> 
>     FilterExpr ::= PrimaryExpr | FilterExpr Predicate
> 
> It would seem that the following rewritten version would be
> much more transparent:
> 
>     FilterExpr ::= PrimaryExpr  Predicate*
> 
> (A number of other productions, e.g., OrExpr, could be
> similarly rewritten.)
> 
> Does anyone know why the production was written the way it
> was?

The two productions are completely equivalent, and the fact that XPath
switches at random between the "recursive" style and the "iterative" style
suggests to me that no thought was given to the matter. I suspect they were
written by different people. Which you prefer is entirely a matter of
personal taste.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread