Since you know SQL, I'll point out that your example is similar to the
SQL query
Select * from Race r1
Where Exists (Select * from RaceType where RaceType > 'R')
And Exists (Select * from RaceType where RaceType < 'R')
And what you expected was
Select * from Race r1
WHere Exists (Select * From RaceTYpe where RaceType > 'R' and RaceType <
'R')
-----Original Message-----
From: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com]
Sent: Thursday, September 18, 2008 11:03 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] Fundimentle Predicate Problem or Bug??
It does pose an interesting question though, because in my case surely
Race/RaceType >= 'R' and Race/RaceType <= 'R'
AND
Race/RaceType >= 'R' or Race/RaceType <= 'R'
would do the same?
I don't think so. If there are two races, of RaceType A and B
respectively, then the first expression is false and the second is true.
Which is fine in the XSLT world but try explaining that to the logic
gurus!
Logic gurus have no problem with the idea that symbols mean whatever you
define them to mean. The people who have problems are those who believe
that symbols can only mean what you were taught at elementary school.
The reason I struggled is because this is how SQL logic works and most
proecdural languages I believe!
Yes, the "implicit existential quantification" is something many people
haven't encountered before, although it has been use for many years in
free-text retrieval query languages.
I tried having a play with your suggestion comparing dates as dates,
but couldn't get to work. The reality is that I have two variables
DATEFROM and DATETO, I can set these to xs:date okay, but how when
with my example data expanded how do you do
<xsl:for-each select="/ORCB082/ROWSET/ROW[Fixture/FixtureDate
>= $DATEFROM and FixtureDate <= $DATETO and
Race/RaceType >= 'R' and Race/RaceType <= 'R']" >
It moans if I wrap xs:date around Fixture/FixtureDate beacuase there
is more than one occurance.
A good way of doing this is to put the cast at the end of the path
expression:
Race/RaceType/xs:date(.) >= xs:date('2008-09-16')
Alternatively, bite the bullet and make it explicit:
some $R in Race/RaceType satisfies xs:date($R) ge xs:date('2008-09-16')
Michael Kay
http://www.saxonica.com/
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--