Chris Hughes wrote:
<ORCB082>
<ROWSET>
<ROW num="1">
<Fixture>
<FixtureDate>2008-10-17</FixtureDate>
<FixtureDayText>DAY ONE TEST</FixtureDayText>
<Race>
<RaceType>S</RaceType>
</Race>
<Race>
<RaceType>H</RaceType>
</Race>
</Fixture>
</ROW>
</ROWSET>
</ORCB082>
Stylesheet 1
------------
This stylesheet outputs "DAY ONE TEST" message, IMO it should match no records
and not output anything.
<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:output method="text" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="/ORCB082/ROWSET/ROW/Fixture[FixtureDate >= '2008-01-01'
and FixtureDate <= '2010-01-01' and
Race/RaceType >= 'R' and
Race/RaceType <= 'R']" >
Race/RaceType >= 'R' is true for the <RaceType>S</RaceType> element,
Race/RaceType <= 'R' is true for the <RaceType>H</RaceType>.
So the result you see is a consequence of >= or <= applied to node-set
operands (in XPath 1.0) or sequence operands (in XPath 2.0) being true
if there is at least one item in each operand node-set/sequence for
which the comparison is true.
--
Martin Honnen
http://JavaScript.FAQTs.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>
--~--