RE: JW15: wildcards

JimW:

You're right of course. We never intended to cause
syntax errors by allowing arbitrary characters
that could be taken for tags. I didn't understand what you
meant. Now I do. I agree with you that we should
be more precise in the BNF in section 5.12.1.
Would you care to suggest what the BNF should be?

Alan Babich

-----Original Message-----
From: Jim Whitehead [mailto:ejw@ics.uci.edu]
Sent: Thursday, June 24, 1999 5:12 PM
To: Babich, Alan; 'DASL'
Subject: RE: JW15: wildcards


> "The BNF for a wildcard permits the entry of "</d:literal>" which
>   would confuse parsers."
>
> The spec. is precise and correct. The second operand
> of the "like" operator is a string literal. (This
> is completely consistent with all the other operators.)
> The syntax of the pattern contained in this string literal
> is given by the BNF in section 5.12.1. The only parser that
> needs to parse the body of the string literal is the
> parser embedded inside the query engine,
> in the implementation of the "like" operator.
> The XML parser won't be confused.
> So, I disagree that either parser would get "confused".
> Parsers don't get confused, people do (and then
> they write bugs). Implementers just need to read
> the spec. carefully.

An XML parser typically doesn't understand the contents inside its elements,
hence an XML parser which saw the sequence:

<d:literal>asdasdada</d:literal></d:literal>

Would be confused, since it would end the element at the first </d:literal>
and would flag an error at the second </d:literal>.  The BNF for the
interior of a literal element allows this to happen, and hence, in my
opinion, should be changed to escape "<" characters.

- Jim

Received on Tuesday, 29 June 1999 17:08:35 UTC