[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Implementing Equality Expressions...

Subject: Implementing Equality Expressions...
From: Tyler Baker <tyler@xxxxxxxxxxx>
Date: Fri, 01 Jan 1999 18:31:06 -0500
equality expression
In the XSL Spec Boolean Expressions are defined as follows...

BooleanExpr ::= AndExpr | OrExpr | BooleanPrimaryExpr
BooleanPrimaryExpr ::= BooleanGroupExpr | NotExpr | PositionalExpr |
TestExpr | EqualityExpr

When trying to parse an equality expression directly, I have found that
it is very difficult to separate the SelectExpression from the Literal
when and expressions or or expressions are also present.

The algorithm I use is basically is to find the first '=' that is not in
a nested expression "anything inside '(' and ')'" and not inside a
literal.  The problem arises is that if you encounter an "and" or an
"or" then you will

I suppose first looking ahead and breaking everything up in terms of
"and" and "or" components would work nicely, but scanning an entire
string expression ahead of time for occurrences of "and" as well as "or"
is suboptimal.

However, if And as well as Or expressions were composed only of
BooleanGroupExpressions, then this problem would be resolved in at least
my implementation (the enclosing '(' and ')' would be used as delimiters
for the beginning and ending of the equality expression).

So instead of having a boolean expression

[foo and @bar="baz"]

You would always have:

[(foo) and (@bar="baz")]

This construction I have found is a lot easier to parse than the way
things currently are defined.

To be specific all I am asking for is that:

AndExpr ::= BooleanPrimaryExpr ( 'and' BooleanPrimaryExpr )+

be changed to:

AndExpr ::= BooleanGroupExpr ( 'and' BooleanGroupExpr )+

and that:

OrExpr ::= BooleanPrimaryExpr ( 'or' BooleanPrimaryExpr )+

be changed to:

OrExpr ::= BooleanGroupExpr ( 'or' BooleanGroupExpr )+

Has this been considered already among the WG?

Tyler

P.S. - This only causes problems for me with parsing equality
expressions but not with anything else...


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.