RE: [xsl] Re: XPath incompatibilities

Subject: RE: [xsl] Re: XPath incompatibilities
From: Joerg Pietschmann <joerg.pietschmann@xxxxxx>
Date: Thu, 03 Jan 2002 17:23:45 +0100
"Michael Kay" <michael.h.kay@xxxxxxxxxxxx> wrote:
> (Another
> option that's on the table is that we never interpret "<" as a lexicographic
> comparison, forcing the user to use the compare() function instead, or
> perhaps the new "lt" operator.).

Just my 2 cents:
- Overloading operators (and functions) too much is not a good idea,
 especially if some of the overloaded semantics is not as widely used
 as others (counting other contextes as well). While using "<" for
 numeric comparisions seems to be commonplace, i don't recall that
 it is widely used for string  comparisions  (even the C++ standard
 libraries don't do that).
 I'd like to see a compare() function, especially because such a
 function is needed anyway for additional parameters in case you want
 to specify a locale or language or such which influences the
 comparision.
- Keep the number of operators small. Operators have to be in the
 grammar, and grammars aren't that easy to keep modular. Keeping
 the grammar small by using operator precendences and association rules
 doesn't avoid the problem, these tables aren't that easy to  keep
 modular either. Functions are much easier to separate into different
 modules/packages/whatever.
- Don't overuse operators consisting of letters, even (or especially)
 if they are words. There is a lot of potential of having them confused
 with other names (unless you make them completely reserved identifiers,
 hardly an option here).
 Especially don't invent a "lt" operator, or any other operator with
 the same name as one of the auto-predefined XML entities (unless you
 want to answer all the newbie questions why they sometimes have to
 write "&lt;" and sometimes "lt" to avoid runtime errors... :-)
 
Regards
J.Pietschmann

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


Current Thread