[xsl] RE: For expressions and / operator in XPath 2.0

Subject: [xsl] RE: For expressions and / operator in XPath 2.0
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 3 Jan 2002 09:28:44 -0000
> It's a shame. I do dislike all the keywords that seem to have infected
> XPath, which make it seem more like a programming language in its own
> right than a simple expression language :( I don't suppose we could
> get rid of this one and use some kind of symbol or operator instead,
> like:
>   //rate -> (@value * @quantity)

Yep. We've certainly now got a rather idiosyncratic mix of syntactic styles:
essentially the old path syntax, based on the same kind of thinking as
regular expressions (terse, readily understood by experts, total gibberish
to anyone else), mixed in with an SQL-style keyword syntax. I suspect this
was inevitable, even without the XML Query input: we were running out of
ASCII characters.

I did at one stage suggest using backslash for a sequence mapping operator

   //rate \ (@value * @quantity)

and I've never had so many rotten tomatoes thrown at me in my life! (It
seems 90% of Microsoft users, which means 80% of the world population, are
incapable of distinguishing "/" from "\").

Another proposal was a simplified FOR expression without range variables,

   for //rate return (@value * @quantity)

but this gets into reserved-word parsing problems.

Mike Kay

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

Current Thread